fulmine.rpc
Interface IRpcManager

All Superinterfaces:
IDestroyable, ILifeCycle, IRpcPublishOperations
All Known Subinterfaces:
IFrameworkContext, IFulmineContext
All Known Implementing Classes:
FTContext, FulmineContext, RpcManager

public interface IRpcManager
extends ILifeCycle, IRpcPublishOperations

The manager for the Remote Procedure Call (RPC) framework. This provides the following facilities for application code:

  1. it allows application code to invoke procedures exposed by other remote contexts
  2. it allows application code to publish procedures that can be invoked by other remote contexts
Application code should register an IRpcPublicationListener to receive events when remote procedures are published or unpublished.

Author:
Ramon Servadei

Field Summary
static String DEFAULT_RPC_TIMEOUT
          The default value for the RPC_TIMEOUT
static String RPC_TIMEOUT
          Defines the system property name for the RPC timeout.
 
Method Summary
 boolean addRpcPublicationListener(String remoteContextIdentity, IRpcPublicationListener listener)
          Add a listener for RPC publication events.
 IRpcMarker invoke(IRpcResultHandler resultHandler, String remoteContextIdentity, String procedure, IField... args)
          Asynchronously invoke the RPC in the named remote context.
 IRpcResult invoke(String remoteContextIdentity, String procedure, IField... args)
          Synchronously invoke the RPC in the named remote context.
 boolean removeRpcPublicationListener(String remoteContextIdentity, IRpcPublicationListener listener)
          Remove an RPC publication listener.
 
Methods inherited from interface fulmine.ILifeCycle
isActive, start
 
Methods inherited from interface fulmine.IDestroyable
destroy
 
Methods inherited from interface fulmine.rpc.IRpcPublishOperations
publishProdedure, publishRpcs, unpublishProdedure, unpublishRpcs
 

Field Detail

RPC_TIMEOUT

static final String RPC_TIMEOUT
Defines the system property name for the RPC timeout. This value is expressed in milliseconds.

See Also:
DEFAULT_RPC_TIMEOUT, Constant Field Values

DEFAULT_RPC_TIMEOUT

static final String DEFAULT_RPC_TIMEOUT
The default value for the RPC_TIMEOUT

See Also:
Constant Field Values
Method Detail

addRpcPublicationListener

boolean addRpcPublicationListener(String remoteContextIdentity,
                                  IRpcPublicationListener listener)
Add a listener for RPC publication events. This will be activated when an RPC publication event is received from any connected remote context.

This is an idempotent operation.

Parameters:
remoteContextIdentity - the remote context to monitor for RPC publish/unpublish events
listener - a listener to receive the RPC publish/unpublish events.
Returns:
true if the listener was added, false otherwise

removeRpcPublicationListener

boolean removeRpcPublicationListener(String remoteContextIdentity,
                                     IRpcPublicationListener listener)
Remove an RPC publication listener. The listener will no longer receive notifications when RPC publish/unpublish events occur. *

This is an idempotent operation.

Parameters:
remoteContextIdentity - the remote context that the listener was monitoring for RPC publish/unpublish events
listener - the listener to remove
Returns:
true if the listener was found and removed, false otherwise

invoke

IRpcResult invoke(String remoteContextIdentity,
                  String procedure,
                  IField... args)
Synchronously invoke the RPC in the named remote context. This method will block until a result is returned or a timeout occurs.

It is assumed that this method is called after an RPC publication event is received by an IRpcPublicationListener.

Parameters:
remoteContextIdentity - the remote context to invoke the RPC in
procedure - the RPC name
args - the arguments for the RPC
Returns:
the result from the RPC
See Also:
RPC_TIMEOUT

invoke

IRpcMarker invoke(IRpcResultHandler resultHandler,
                  String remoteContextIdentity,
                  String procedure,
                  IField... args)
Asynchronously invoke the RPC in the named remote context. It is assumed that this method is called after an RPC publication event is received by an IRpcPublicationListener

Parameters:
resultHandler - the handler to process the asynchronous result
remoteContextIdentity - the remote context to invoke the RPC in
procedure - the RPC name
args - the arguments for the RPC
Returns:
a marker that allows the resultHandler to tie up the result from this specific RPC invocation


Copyright © 2007-2009. All Rights Reserved.