edu.emory.mathcs.rmix
Interface AsyncInvoker

All Superinterfaces:
Invoker
All Known Implementing Classes:
AbstractAsyncInvoker

public interface AsyncInvoker
extends Invoker

The extended version of the Invoker that supports asynchronous method invocations. Implementations should return instance of this interface from the RemoteRef.bind(edu.emory.mathcs.rmix.Parameters, java.lang.ClassLoader, boolean) call if they wish to support asynchronous invocations.

Version:
1.0
Author:
Dawid Kurzyniec

Method Summary
 Rmix.Future invokeAsync(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] params)
          Schedules the asynchronous remote method invocation that uses the Rmix.Future object to indicate completion.
 Rmix.Future invokeCbAsync(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] params, Callback callback)
          Schedules the asynchronous remote method invocation that uses the Rmix.Future object and the specified callback to indicate completion.
 void invokeOneWay(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] params)
          Schedules the one-way remote method invocation that offers no indication of completion.
 
Methods inherited from interface edu.emory.mathcs.rmix.Invoker
getBindParameters, getInterfaces, getParameter, getRef, invoke, setParameter
 

Method Detail

invokeAsync

public Rmix.Future invokeAsync(java.lang.Object proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] params)
                        throws java.rmi.RemoteException
Schedules the asynchronous remote method invocation that uses the Rmix.Future object to indicate completion. This method must ensure that params are marshalled or copied before returning, so that subsequent changes to the state of params do not affect the invocation that may be still in progress. Additionally, the implementation must ensure that asynchronous calls performed from the same thread on the same stub are serialized on the server side The requested method must belong to one of the interfaces available through Invoker.getInterfaces().

Parameters:
proxy - the client-side proxy that originated the invocation.
method - the remote method to invoke.
params - invocation parameters.
Returns:
the future object that will hold the value returned by the remote method call (or exception thrown by it) once the call completes.
Throws:
java.rmi.RemoteException - if the call could not be performed.

invokeCbAsync

public Rmix.Future invokeCbAsync(java.lang.Object proxy,
                                 java.lang.reflect.Method method,
                                 java.lang.Object[] params,
                                 Callback callback)
                          throws java.rmi.RemoteException
Schedules the asynchronous remote method invocation that uses the Rmix.Future object and the specified callback to indicate completion. This method must ensure that params are marshalled or copied before returning, so that subsequent changes to the state of params do not affect the invocation that may be still in progress. The requested method must belong to one of the interfaces available through Invoker.getInterfaces().

Parameters:
proxy - the client-side proxy that originated the invocation.
method - the remote method to invoke.
params - invocation parameters.
callback - the callback to receive notification once the call completes.
Returns:
the future object that will hold the value returned by the remote method call (or exception thrown by it) once the call completes.
Throws:
java.rmi.RemoteException - if the call could not be performed.

invokeOneWay

public void invokeOneWay(java.lang.Object proxy,
                         java.lang.reflect.Method method,
                         java.lang.Object[] params)
                  throws java.rmi.RemoteException
Schedules the one-way remote method invocation that offers no indication of completion. This method must ensure that params are marshalled or copied before returning, so that subsequent changes to the state of params do not affect the invocation that may be still in progress. The requested method must belong to one of the interfaces available through Invoker.getInterfaces().

Parameters:
proxy - the client-side proxy that originated the invocation.
method - the remote method to invoke.
params - invocation parameters.
Returns:
the future object that will hold the value returned by the remote method call (or exception thrown by it) once the call completes.
Throws:
java.rmi.RemoteException - if the call could not be performed.