Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl-hive
Commits
58a243be
Commit
58a243be
authored
Feb 26, 2014
by
Leo Gordon
Browse files
allow aliasing of adaptors (signature now depends on the actual module name)
parent
0b0c9bf6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
22 deletions
+29
-22
modules/Bio/EnsEMBL/Hive/DBSQL/DBAdaptor.pm
modules/Bio/EnsEMBL/Hive/DBSQL/DBAdaptor.pm
+29
-22
No files found.
modules/Bio/EnsEMBL/Hive/DBSQL/DBAdaptor.pm
View file @
58a243be
...
...
@@ -159,25 +159,31 @@ sub hive_use_param_stack { # getter only, not setter
}
our
%adaptor_type_2_package_name
=
(
'
Accumulator
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::AccumulatorAdaptor
',
'
Analysis
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::AnalysisAdaptor
',
'
AnalysisCtrlRule
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::AnalysisCtrlRuleAdaptor
',
'
AnalysisData
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::AnalysisDataAdaptor
',
'
AnalysisJob
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::AnalysisJobAdaptor
',
'
AnalysisStats
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::AnalysisStatsAdaptor
',
'
DataflowRule
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::DataflowRuleAdaptor
',
'
LogMessage
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::LogMessageAdaptor
',
'
Meta
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::MetaAdaptor
',
'
MetaContainer
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::MetaContainer
',
'
NakedTable
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::NakedTableAdaptor
',
'
ResourceClass
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::ResourceClassAdaptor
',
'
ResourceDescription
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::ResourceDescriptionAdaptor
',
'
Queen
'
=>
'
Bio::EnsEMBL::Hive::Queen
',
# aliases:
'
Job
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::AnalysisJobAdaptor
',
'
Worker
'
=>
'
Bio::EnsEMBL::Hive::Queen
',
);
sub
get_available_adaptors
{
my
%pairs
=
(
'
Accumulator
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::AccumulatorAdaptor
',
'
Analysis
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::AnalysisAdaptor
',
'
AnalysisCtrlRule
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::AnalysisCtrlRuleAdaptor
',
'
AnalysisData
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::AnalysisDataAdaptor
',
'
AnalysisJob
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::AnalysisJobAdaptor
',
'
AnalysisStats
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::AnalysisStatsAdaptor
',
'
DataflowRule
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::DataflowRuleAdaptor
',
'
LogMessage
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::LogMessageAdaptor
',
'
Meta
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::MetaAdaptor
',
'
MetaContainer
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::MetaContainer
',
'
NakedTable
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::NakedTableAdaptor
',
'
ResourceClass
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::ResourceClassAdaptor
',
'
ResourceDescription
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::ResourceDescriptionAdaptor
',
'
Queen
'
=>
'
Bio::EnsEMBL::Hive::Queen
',
);
return
\
%pairs
;
return
\
%adaptor_type_2_package_name
;
}
...
...
@@ -207,13 +213,14 @@ sub parse_underscored_id_name {
sub
get_adaptor
{
my
$self
=
shift
;
my
$type
=
shift
;
my
$AdaptorType
=
shift
;
my
$adaptor_package_name
=
$self
->
get_available_adaptors
()
->
{
$AdaptorType
}
or
throw
("
Could not find a module corresponding to '
$AdaptorType
'
");
my
$signature
=
join
('
:
',
$
typ
e
,
@
_
);
my
$signature
=
join
('
:
',
$
adaptor_package_nam
e
,
@
_
);
unless
(
$self
->
{'
_cached_adaptor
'}{
$signature
}
)
{
my
$adaptor_package_name
=
$self
->
get_available_adaptors
()
->
{
$type
}
or
throw
("
Could not find a module corresponding to '
$type
'
");
eval
"
require
$adaptor_package_name
"
or
throw
("
Could not load or compile module '
$adaptor_package_name
'
");
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment