| 1 | package RPC::Simple::AnyLocal; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 1 | ▶ | use vars qw(@ISA $VERSION %_RPC_SUBS); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 1 | ▶ | use RPC::Simple::Agent ; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 1 | ▶ | use RPC::Simple::AnyWhere ; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | # Items to export into callers namespace by default. Note: do not export | ||||||||||
| 11 | # names by default without a very good reason. Use EXPORT_OK instead. | ||||||||||
| 12 | # Do not simply export all your public functions/methods/constants. | ||||||||||
| 13 | |||||||||||
| 14 | 1 | ( $VERSION ) = '$Revision: 1.8 $ ' =~ /\$Revision:\s+([^\s]+)/; | |||||||||
| 15 | |||||||||||
| 16 | 1 | @ISA = qw(RPC::Simple::AnyWhere) ; | |||||||||
| 17 | 1 | *_RPC_SUBS=*RPC::Simple::AnyWhere::_RPC_SUBS; | |||||||||
| 18 | # Preloaded methods go here. | ||||||||||
| 19 | |||||||||||
| 20 | # We may need a mechanism to declare the functions vailable on the remote | ||||||||||
| 21 | # side | ||||||||||
| 22 | |||||||||||
| 23 | sub createRemote | ||||||||||
| 24 | 1 | ▶ | { | ||||||||
|
Subroutine
createRemote: called CC=3 SCAR=11.1
Pod
documented
| |||||||||||
| 25 | 1 | my $self = shift ; | |||||||||
| 26 | 1 | my $factory = shift ; | |||||||||
| 27 | 1 | my $remoteClass = shift ; | |||||||||
| 28 | |||||||||||
| 29 | 1 | ▶ | die "No factory object given to ",ref($self),"->createRemote\n" | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | unless defined $factory ; | ||||||||||
| 31 | |||||||||||
| 32 | # construct an array of existing remote functions and store it in the | ||||||||||
| 33 | # child class name space (rude but necessary behavior) | ||||||||||
| 34 | 1 | ▶ | unless (defined $_RPC_SUBS{ref($self)}) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 35 | { | ||||||||||
| 36 | 1 | $self->_searchSubs(ref($self)) ; | |||||||||
| 37 | } | ||||||||||
| 38 | |||||||||||
| 39 | # create real process object | ||||||||||
| 40 | $self->{_twinHandle} = | ||||||||||
| 41 | 1 | $factory->newRemoteObject($self, $remoteClass, @_ ) ; | |||||||||
| 42 | |||||||||||
| 43 | 1 | $self->{remoteHostName} = $self->{_twinHandle}->getRemoteHostName() ; | |||||||||
| 44 | |||||||||||
| 45 | 1 | return $self ; | |||||||||
| 46 | } | ||||||||||
| 47 | |||||||||||
| 48 | sub destroy | ||||||||||
| 49 | 0 | ▶ | { | ||||||||
|
Subroutine
destroy: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 50 | 0 | my $self = shift ; | |||||||||
| 51 | 0 | print "AnyLocal object destroyed\n" ; | |||||||||
| 52 | 0 | $self->{_twinHandle}->destroy; | |||||||||
| 53 | 0 | undef $self->{_twinHandle} ; | |||||||||
| 54 | } | ||||||||||
| 55 | |||||||||||
| 56 | # Autoload methods go after =cut, and are processed by the autosplit program. | ||||||||||
| 57 | |||||||||||
| 58 | 1 | 1; | |||||||||
| 59 | __END__ | ||||||||||