2 |
## $Id$ |
## $Id$ |
3 |
## -------------------------------------------------------------------------------- |
## -------------------------------------------------------------------------------- |
4 |
## $Log$ |
## $Log$ |
5 |
|
## Revision 1.10 2003/01/19 02:31:51 joko |
6 |
|
## + fix to 'sub AUTOLOAD' |
7 |
|
## |
8 |
## Revision 1.9 2002/12/19 16:30:23 joko |
## Revision 1.9 2002/12/19 16:30:23 joko |
9 |
## + added 'sub dropDb' and 'sub rebuildDb' as croakers for concrete implementations of methods in proper handlers |
## + added 'sub dropDb' and 'sub rebuildDb' as croakers for concrete implementations of methods in proper handlers |
10 |
## |
## |
68 |
bless $self, $class; |
bless $self, $class; |
69 |
=cut |
=cut |
70 |
|
|
71 |
|
#=pod |
72 |
# V2 - maybe more convenient/secure? utilizing Damian Conway's Tie::SecureHash... |
# V2 - maybe more convenient/secure? utilizing Damian Conway's Tie::SecureHash... |
73 |
my $self = Tie::SecureHash->new( |
my $self = Tie::SecureHash->new( |
74 |
$class, |
$class, |
92 |
#_protected => , |
#_protected => , |
93 |
#__private => , |
#__private => , |
94 |
); |
); |
95 |
|
#=cut |
96 |
|
|
97 |
# merge passed-in arguments to constructor as properties into already blessed secure object |
# merge passed-in arguments to constructor as properties into already blessed secure object |
98 |
|
|
127 |
} |
} |
128 |
|
|
129 |
|
|
130 |
|
# TODO: use NEXT.pm inside this mechanism (to avoid repetitions...) |
131 |
sub AUTOLOAD { |
sub AUTOLOAD { |
132 |
|
|
133 |
# recursion problem to be avoided here!!! |
# recursion problem to be avoided here!!! |
164 |
#if (!$self->exists('COREHANDLE')) { return; } |
#if (!$self->exists('COREHANDLE')) { return; } |
165 |
|
|
166 |
# handle locking (hack) |
# handle locking (hack) |
167 |
if ($self->exists('lock_info') && $self->{lock_info}->{last_method} && $methodname eq $self->{lock_info}->{last_method}) { |
if ($self->can('exists') && $self->exists('lock_info') && $self->{lock_info}->{last_method} && $methodname eq $self->{lock_info}->{last_method}) { |
168 |
$self->{lock_info}->{log_lock} = 1; |
$self->{lock_info}->{log_lock} = 1; |
169 |
} else { |
} else { |
170 |
$self->{lock_info}->{log_lock} = 0; |
$self->{lock_info}->{log_lock} = 0; |
185 |
#if (!$self->exists('_COREHANDLE')) { |
#if (!$self->exists('_COREHANDLE')) { |
186 |
#if (!$self->{_COREHANDLE}) { |
#if (!$self->{_COREHANDLE}) { |
187 |
if (!$core) { |
if (!$core) { |
188 |
my $err_msg_core = __PACKAGE__ . "[$self->{metainfo}->{type}]" . ": " . "COREHANDLE is undefined while trying to execute method \"$methodname\""; |
|
189 |
|
#print Dumper($self); |
190 |
|
#exit; |
191 |
|
|
192 |
|
my $handlertype = $self->{metainfo}->{type}; |
193 |
|
$handlertype ||= ''; |
194 |
|
|
195 |
|
my $err_msg_core = __PACKAGE__ . "[$handlertype]" . ": " . "COREHANDLE is undefined while trying to execute method \"$methodname\""; |
196 |
print $err_msg_core, "\n"; |
print $err_msg_core, "\n"; |
197 |
if ($self->exists('lock_info') && !$self->{lock_info}->{log_lock}) { |
if ($self->exists('lock_info') && !$self->{lock_info}->{log_lock}) { |
198 |
$logger->error( $err_msg_core ); |
$logger->error( $err_msg_core ); |
238 |
|
|
239 |
#print "calling: $methodname", "\n"; |
#print "calling: $methodname", "\n"; |
240 |
|
|
241 |
# method calls doing it until here will get dispatched to the proper handler |
# method calls making it until here will get dispatched to the proper handler |
242 |
return $core->$methodname(@_); |
return $core->$methodname(@_); |
243 |
|
|
244 |
} elsif ($self->can($methodname)) { |
} elsif ($self->can($methodname)) { |
245 |
|
# try to call specified method inside our or inherited module(s) scope(s) |
246 |
return $self->$methodname(@_); |
return $self->$methodname(@_); |
247 |
} |
} |
248 |
|
|
279 |
my $self = shift; |
my $self = shift; |
280 |
my $nodename = shift; |
my $nodename = shift; |
281 |
#$nodename = 'TransactionRoutingTable'; |
#$nodename = 'TransactionRoutingTable'; |
282 |
$logger->debug( __PACKAGE__ . "->getChildNode( nodename $nodename )" ); |
$logger->debug( __PACKAGE__ . "->existsChildNode( nodename $nodename )" ); |
283 |
$self->getChildNodes() unless $self->{meta}->{childnodes}; |
$self->getChildNodes() unless $self->{meta}->{childnodes}; |
284 |
my $result = grep(m/$nodename/i, @{$self->{meta}->{childnodes}}); # TODO: use "/i" only on win32-systems! |
my $result = grep(m/$nodename/i, @{$self->{meta}->{childnodes}}); # TODO: use "/i" only on win32-systems! |
285 |
return $result; |
return $result; |