fulmine.distribution
Class RemoteUpdateInvoker

java.lang.Object
  extended by fulmine.distribution.RemoteUpdateInvoker
All Implemented Interfaces:
IRemoteUpdateInvoker, IRpcPublicationListener

public final class RemoteUpdateInvoker
extends Object
implements IRemoteUpdateInvoker

A standard implementation.

Author:
Ramon Servadei

Field Summary
static String DEFAUL_RPC_TIMEOUT
          The default RPC timeout, 5 seconds
static String RPC_TIMEOUT_PROPERTY
          System property to define the timeout (in milliseconds) for waiting for RPC invocations.
 
Constructor Summary
RemoteUpdateInvoker(String remoteContextIdentity, IFulmineContext context)
          Standard constructor
 
Method Summary
 boolean equals(Object obj)
           
 int hashCode()
           
 IRpcResult invoke(String remoteContextIdentity, StringField identity, IntegerField type, IntegerField domain, StringField fieldName, StringField valueAsString, IntegerField permissionApp, IntegerField permissionCode, StringField originatingRemoteContextIdentity)
          Invoke the 'update remote container' RPC in the named remote context.
 void procedureAvailable(String remoteContextIdentity, IRpcDefinition rpcDefinition)
          Executed when the local context can invoke the named RPC in the identified remote context.
 void procedureUnavailable(String remoteContextIdentity, IRpcDefinition rpcDefinition)
          Executed when a remote context unpublishes (removes) the named RPC.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RPC_TIMEOUT_PROPERTY

public static final String RPC_TIMEOUT_PROPERTY
System property to define the timeout (in milliseconds) for waiting for RPC invocations.

See Also:
DEFAUL_RPC_TIMEOUT

DEFAUL_RPC_TIMEOUT

public static final String DEFAUL_RPC_TIMEOUT
The default RPC timeout, 5 seconds

See Also:
Constant Field Values
Constructor Detail

RemoteUpdateInvoker

public RemoteUpdateInvoker(String remoteContextIdentity,
                           IFulmineContext context)
Standard constructor

Parameters:
remoteContextIdentity - the remote context identity this invoker handles.
Method Detail

procedureAvailable

public void procedureAvailable(String remoteContextIdentity,
                               IRpcDefinition rpcDefinition)
Description copied from interface: IRpcPublicationListener
Executed when the local context can invoke the named RPC in the identified remote context.

Specified by:
procedureAvailable in interface IRpcPublicationListener
Parameters:
remoteContextIdentity - the remote context that has published the procedure, when calling the procedure, this remote context will handle it
rpcDefinition - the RPC definition

procedureUnavailable

public void procedureUnavailable(String remoteContextIdentity,
                                 IRpcDefinition rpcDefinition)
Description copied from interface: IRpcPublicationListener
Executed when a remote context unpublishes (removes) the named RPC. The RPC is no longer available for invocation.

Specified by:
procedureUnavailable in interface IRpcPublicationListener
Parameters:
remoteContextIdentity - the remote context that has unpublished the RPC
rpcDefinition - the RPC definition that has been removed

invoke

public IRpcResult invoke(String remoteContextIdentity,
                         StringField identity,
                         IntegerField type,
                         IntegerField domain,
                         StringField fieldName,
                         StringField valueAsString,
                         IntegerField permissionApp,
                         IntegerField permissionCode,
                         StringField originatingRemoteContextIdentity)
Description copied from interface: IRemoteUpdateInvoker
Invoke the 'update remote container' RPC in the named remote context. Whether this is called before or after the RPC registry for the remote context is received is of no consequence; the invocation will occur only when the RPC registry has been received.

Specified by:
invoke in interface IRemoteUpdateInvoker
Parameters:
remoteContextIdentity - the remote context to invoke the RPC in
identity - the container identity, used to locate the container
type - the container type, used to locate the container
domain - the container domain, used to locate the container
fieldName - the field in the container to update
valueAsString - the new value for the field, in string form
permissionApp - the application permission of the context issuing the change, see IPermissionProfile
permissionCode - the permission of the context issuing the change, see IPermissionProfile
originatingRemoteContextIdentity - the identity of the remote context issuing the command
Returns:
the result from the RPC
See Also:
#RPC_TIMEOUT_PROPERTY

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2007-2009. All Rights Reserved.