edu.emory.mathcs.rmix
Interface Invoker

All Known Subinterfaces:
AsyncInvoker
All Known Implementing Classes:
AbstractAsyncInvoker, AbstractInvoker

public interface Invoker

The client-side remote object reference resolved against a specific class loader and capable of invoking remote methods on the target object.

Version:
1.0
Author:
Dawid Kurzyniec

Method Summary
 Parameters getBindParameters()
          Retrieves parameters associated with this invoker.
 java.lang.Class[] getInterfaces()
          Gets remote interfaces which methods may be invoked on the target object through this invoker.
 java.lang.Object getParameter(java.lang.String name)
          Gets the value of the provider-specific parameter with a given name.
 RemoteRef getRef()
          Gets the RemoteRef that this invoker is bound to.
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] params)
          Performs the remote method invocation.
 void setParameter(java.lang.String name, java.lang.Object value)
          Sets the value of the provider-specific parameter given by name.
 

Method Detail

getInterfaces

public java.lang.Class[] getInterfaces()
Gets remote interfaces which methods may be invoked on the target object through this invoker.

Returns:
exported remote interfaces.

getRef

public RemoteRef getRef()
Gets the RemoteRef that this invoker is bound to.

Returns:
the RemoteRef of this invoker.

getBindParameters

public Parameters getBindParameters()
Retrieves parameters associated with this invoker. Binding to this invoker's remote reference using these parameters will create invoker indistinguishable from this one.

Returns:
bind parameters

setParameter

public void setParameter(java.lang.String name,
                         java.lang.Object value)
                  throws IllegalParameterException,
                         java.lang.UnsupportedOperationException
Sets the value of the provider-specific parameter given by name. Implementations should reject any parameter that they do not support by throwing IllegalParameterException.

Parameters:
name - the name of the parameter to set.
value - the value of the parameter.
Throws:
IllegalParameterException - if the provider does not recognize the parameter with that name, or if the parameter is not of the appropriate type.
java.lang.UnsupportedOperationException - if the parameter cannot be written (for instance, if it is read-only).

getParameter

public java.lang.Object getParameter(java.lang.String name)
                              throws IllegalParameterException,
                                     java.lang.UnsupportedOperationException
Gets the value of the provider-specific parameter with a given name.

Parameters:
name - the parameter name.
Returns:
the parameter value.
Throws:
IllegalParameterException - if the provider does not recognize the parameter with that name.
java.lang.UnsupportedOperationException - if the parameter cannot be read (for instance, if it is write-only).

invoke

public java.lang.Object invoke(java.lang.Object proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] params)
                        throws java.lang.Exception
Performs the remote method invocation. The requested method must belong to one of the interfaces available through #getInterfaces.

Parameters:
proxy - the client-side proxy that originated the invocation.
method - the remote method to invoke.
params - invocation parameters.
Returns:
the value returned by the remote method call.
Throws:
java.lang.Exception - exception thrown by the remote method.