mandala.rami
Interface AsynchronousReference

All Superinterfaces:
Reference
All Known Subinterfaces:
AsynchronousReferencePair
All Known Implementing Classes:
AbstractAsynchronousReference, AsynchronousReferencePairImpl

public interface AsynchronousReference
extends Reference

Asynchronous reference on an object.

This interface defines how the methods of the object returned by getObject() can be invoked asynchronously with the call() method.

Implementation classes must implement a variant of the singleton design pattern as defined in the mandala.rami package.

Each invocation of call() uses a Callback providing a done method which is called once a reflexive asynchronous method invocation has terminated. Only one callback is used on each asynchronous method invocation. See the CallbackList if multiple callbacks are to be used.

Version:
1.0
Author:
eipi
See Also:
FutureClient, CallbackManager, Callback

Method Summary
 FutureClient call(MethodOp method, java.lang.Object[] args)
          Call a method asynchronously.
 FutureClient call(MethodOp method, java.lang.Object[] args, Callback callback)
          Call a method asynchronously.
 CallbackManager getCallbackManager()
          Returns the CallbackManager of this instance.
 
Methods inherited from interface mandala.rami.Reference
getObject
 

Method Detail

call

public FutureClient call(MethodOp method,
                         java.lang.Object[] args)

Call a method asynchronously.

Since the call is asynchronous, exceptions are not handled in an usual way. Implementations must provide a mechanism conform to the FutureClient specification.

The method Callback.done(InvocationInfo, MethodResult) of the instance returned by CallbackManager.getCallback() is called once the reflexive asynchronous method invocation is done.

Parameters:
method - the method to call
args - method's parameters
Returns:
a FutureClient object.
See Also:
FutureClient, CallbackManager, Callback

call

public FutureClient call(MethodOp method,
                         java.lang.Object[] args,
                         Callback callback)

Call a method asynchronously.

Since the call is asynchronous, exceptions are not handled in an usual way. Implementations must provide a mechanism conform to the FutureClient specification.

The method done of the specified Callback is called once the reflexive asynchronous method invocation is done. The Callback instance returned by CallbackManager.getCallback() is not used. If multiple callbacks are needed, see CallbackList.

Parameters:
method - the method to call
args - method's parameters
callback - the callback to use.
Returns:
a FutureClient object.
See Also:
FutureClient, Callback, CallbackList

getCallbackManager

public CallbackManager getCallbackManager()

Returns the CallbackManager of this instance.

Returns:
the CallbackManager of this instance.
See Also:
CallbackManager


Mandala help mailing list