| 2 |
## $Id$ |
## $Id$ |
| 3 |
## -------------------------------------------------------------------------------- |
## -------------------------------------------------------------------------------- |
| 4 |
## $Log$ |
## $Log$ |
| 5 |
|
## Revision 1.2 2002/12/15 02:06:15 joko |
| 6 |
|
## + feature to be able to specify module in non-perl-style when loading plugins: e.g. $process->load('Setup/Storage') |
| 7 |
|
## |
| 8 |
## Revision 1.1 2002/12/13 21:46:29 joko |
## Revision 1.1 2002/12/13 21:46:29 joko |
| 9 |
## + initial check-in |
## + initial check-in |
| 10 |
## |
## |
| 18 |
|
|
| 19 |
use base qw( DesignPattern::Object ); |
use base qw( DesignPattern::Object ); |
| 20 |
|
|
| 21 |
|
use Data::Dumper; |
| 22 |
|
|
| 23 |
## ======== object inheritance ======== |
## ======== object inheritance ======== |
| 24 |
|
|
| 25 |
# TODO: |
# TODO: |
| 85 |
|
|
| 86 |
my $modulename_load = shift; |
my $modulename_load = shift; |
| 87 |
|
|
| 88 |
|
# substitute slashes through double double-colons to load modules perl-style |
| 89 |
|
$modulename_load =~ s/\//::/g; |
| 90 |
|
|
| 91 |
my $package = $self_classname . '::' . $modulename_load; |
my $package = $self_classname . '::' . $modulename_load; |
| 92 |
$logger->info( __PACKAGE__ . "->load: $package" ); |
$logger->info( __PACKAGE__ . "->load: $package" ); |
| 93 |
|
|
| 94 |
# this is the module testing phase - use mixin doesn't seem to propagate errors by default |
# this is the module testing phase - use mixin doesn't seem to propagate errors by default |
| 95 |
eval("use $package;"); |
eval("use $package;"); |
| 96 |
if ($@) { |
if ($@) { |
| 97 |
$logger->error( __PACKAGE__ . "->load: $@" ); |
# include caller information |
| 98 |
|
my @caller = caller; |
| 99 |
|
my $caller_msg = $caller[1] . ':' . $caller[2]; |
| 100 |
|
$logger->error( __PACKAGE__ . "->load: $@ ($caller_msg)" ); |
| 101 |
} |
} |
| 102 |
|
|
| 103 |
#print "ref-1: ", ref $self, "\n"; |
#print "ref-1: ", ref $self, "\n"; |