NAME

RPC::Simple::Agent - Perl extension for an agent object for SRPC

SYNOPSIS

use RPC::Simple::Agent ;

DESCRIPTION

This class is an agent for client class inheriting SPRC::Any. This class will handle all the boring stuff to create, access store call-back when dealing with the remote object.

This class should not be used directly. RPC::Simple::AnyLocal will deal with it.

new( $factory_ref, client_ref, spec_ref, context_spec_ref, optionnal_hash_ref )

Create the agent.

factory_ref is the SPRC::Factory object.

client_ref is the client object itself.

context_ref and spec_ref and optionnal_hash_ref are 3 hash containing relevant info tor the remote object.

The content of these hash are merged in that order (i.e. the first values may be clobberred) before the remote object is created.

TBD: Whether it's a good idea to merge these hashes or not.

Methods

getRemoteHostName

returns the remote host name

delegate( method_name , ['callback' => funref | [$obj, 'method'] ], parameter ,... )

Call a method of the remote object. If call back is specified, the call back will be called with whatever parameters the remote functions passed in its reply.

optionnal parameters are passed as is to the remote.

Note that ref are copied. You can't expect the remote to be able to modify a client's variable because you passed it's ref to the remote. nuff' said.

callMethod( method_name, argument_array_ref )

Function used to call the owner of the agent. All arguments of the function to be called back are passed in the array ref.

treatCallBack ( request_id, argument_array_ref)

Function used to call-back the owner of the agent. All arguments of the function to be called back are passed in the array ref.

'request_id' is used to know what object and methos are to be called back. These info were stored by the delegate function.

AUTHOR

Dominique_Dumont@grenoble.hp.com

SEE ALSO

perl(1), RPC::Simple::AnyLocal(3).