NAME

RPC::Simple::AnyLocal - Perl extension defining a virtual SRPC client class

SYNOPSIS

use RPC::Simple::AnyLocal;

package MyLocal ;
use vars qw($VERSION @ISA) ;
@ISA = qw(RPC::Simple::AnyLocal);

sub new
 {
   my $type = shift ;

   my $self = {} ;
   my $remote =  shift ;
   bless $self,$type ;

   $self->createRemote($remote) ;
   return $self ;
 }

# Note that the 'remoteHello' method is not part of MyLocal

package main;

# client part
my $mw = MainWindow-> new ;
my $verbose = 1 ;

# create fatory
my $factory = new RPC::Simple::Factory($mw,\$verbose) ;
my $local = new MyLocal($factory) ;
$mw -> Button (text => 'quit', command => sub {exit;} ) -> pack ;
$mw -> Button (text => 'remoteAct',
  command => sub {$local->remoteHello();} ) -> pack ;

MainLoop ; # Tk's

DESCRIPTION

This class must be herited by a sub-class so this one can use the SRPC facility.

Note that this class (and the Factory class) was designed to use Tk's fileevent facilities.

Methods

createRemote(ref)

This method should be called by the child object during start-up. It will ask the SRPC factory to create a ClientAgent class dedicated to this new object.

The hash will be copied by Data::Dumper and passed to the remote object during ots creation.

AUTOLOAD()

When this method is called (generally through perl mechanism), the call will be forwarded with all parameter to the remote object. If the parameters are :

'callback' => \$one_callback

the function &one_callback will be called.

If the parameters are 'callback' => [ $anobject, 'a_method' ]. Then this object method will be called back.

setUserName()

This method may be used by the remote object to set the 'userName' instance variable of RPC::Simple::AnyLocal.

instance variable

AnyLocal will create the following instance variables:

remoteHandle

Will contains the ref of the RPC::Simple::Agent object.

remoteHostName

Will contains the name of the remote host.

AUTHOR

Dominique Dumont, Dominique_Dumont@grenoble.hp.com

SEE ALSO

perl(1), RPC::Simple::Factory(3), RPC::Simple::AnyRemote(3)