mandala.rami.impl
Class AsynchronousReferenceImpl

java.lang.Object
  extended bymandala.rami.AbstractAsynchronousReference
      extended bymandala.rami.impl.AsynchronousReferenceImpl
All Implemented Interfaces:
AsynchronousReference, Reference, java.io.Serializable

public class AsynchronousReferenceImpl
extends AbstractAsynchronousReference

Implementation of the AsynchronousReference interface.

This implementation uses the factory design pattern to customize future objects creation. This class provides a default FutureFactory with a standard behavior.

Version:
1.0
Author:
eipi
See Also:
AbstractAsynchronousReference, AsynchronousPolicy, FutureClient, FutureServer, FutureFactory, FutureFactory.FutureComponents, CallbackManager, Serialized Form

Field Summary
protected  FutureFactory futureFactory
          The FutureFactory instance used to create our future objects.
protected  java.lang.Object object
          The Object methods must be invoked asynchronously on.
protected  AsynchronousPolicy policy
          The asynchronous policy.
 
Fields inherited from class mandala.rami.AbstractAsynchronousReference
callbackManager, syslog
 
Constructor Summary
protected AsynchronousReferenceImpl(java.lang.Object object, CallbackManager callBackManager, FutureFactory futureFactory, AsynchronousPolicy policy)
          Creates a new AsynchronousReferenceImpl instance.
 
Method Summary
 FutureClient call(MethodOp method, java.lang.Object[] args, Callback callBack)
          Call a method asynchronously.
 AsynchronousPolicy getAsynchronousPolicy()
          Returns the object used to invoke method on the object returned by getObject().
 FutureFactory getFutureFactory()
          Returns the factory used to construct futures.
static AsynchronousReferenceImpl getInstance(java.lang.Object object, CallbackManager callBackManager, FutureFactory futureFactory, AsynchronousPolicy policy)
           
 java.lang.Object getObject()
          Returns the object this Reference refers to.
 java.lang.String toString()
           
 
Methods inherited from class mandala.rami.AbstractAsynchronousReference
call, getCallbackManager, getSyslog, setSyslog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

object

protected final java.lang.Object object

The Object methods must be invoked asynchronously on.


futureFactory

protected final FutureFactory futureFactory

The FutureFactory instance used to create our future objects.

See Also:
FutureFactory

policy

protected final AsynchronousPolicy policy

The asynchronous policy.

See Also:
AsynchronousPolicy
Constructor Detail

AsynchronousReferenceImpl

protected AsynchronousReferenceImpl(java.lang.Object object,
                                    CallbackManager callBackManager,
                                    FutureFactory futureFactory,
                                    AsynchronousPolicy policy)

Creates a new AsynchronousReferenceImpl instance.

Parameters:
object - the Object methods must be invoked asynchronously on.
policy - the AsynchronousPolicy to delegate method invocation to.
futureFactory - the FutureFactory responsible of the creation of future objects.
callBackManager - the manager of Callback for this instance.
Method Detail

call

public FutureClient call(MethodOp method,
                         java.lang.Object[] args,
                         Callback callBack)
Description copied from interface: AsynchronousReference

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.

Specified by:
call in interface AsynchronousReference
Specified by:
call in class AbstractAsynchronousReference

getObject

public java.lang.Object getObject()
Description copied from interface: Reference

Returns the object this Reference refers to.

Returns:
the object this Reference refers to.

toString

public java.lang.String toString()
Overrides:
toString in class AbstractAsynchronousReference

getFutureFactory

public FutureFactory getFutureFactory()

Returns the factory used to construct futures.

Returns:
the factory used to construct futures

getAsynchronousPolicy

public AsynchronousPolicy getAsynchronousPolicy()

Returns the object used to invoke method on the object returned by getObject().

Returns:
the object used to invoke method on the object returned by getObject()

getInstance

public static AsynchronousReferenceImpl getInstance(java.lang.Object object,
                                                    CallbackManager callBackManager,
                                                    FutureFactory futureFactory,
                                                    AsynchronousPolicy policy)


Mandala help mailing list