mandala.rami.impl
Class AsynchronousReferencePairImpl

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

public class AsynchronousReferencePairImpl
extends AbstractAsynchronousReference
implements AsynchronousReferencePair

Direct implementation of the AsynchronousReferencePair class.

Since:
1.0
Version:
1.0
Author:
eipi
See Also:
AsynchronousReferencePair, Serialized Form

Nested Class Summary
 
Nested classes inherited from class mandala.rami.AsynchronousReferencePair
AsynchronousReferencePair.CallReflection
 
Field Summary
protected  AsynchronousReference head
           
 
Fields inherited from class mandala.rami.AbstractAsynchronousReference
callbackManager, syslog
 
Constructor Summary
protected AsynchronousReferencePairImpl(AsynchronousReference head, CallbackManager callbackManager)
          Creates a new AsynchronousReferencePairImpl instance.
 
Method Summary
 FutureClient call(MethodOp method, java.lang.Object[] args, Callback callback)
          Call a method asynchronously.
 CallbackManager getCallbackManager()
          Returns the CallbackManager of this instance.
 AsynchronousReference getHead()
          Returns the head of this asynchronous reference pair.
static AsynchronousReferencePairImpl getInstance(AsynchronousReference head, CallbackManager callbackManager)
          Gets the AsynchronousReferencePairImpl instance which handles reflexive asynchronous method invocation on the specified pair of asynchronous reference.
 java.lang.Object getObject()
          Returns the object this Reference refers to.
static Syslog getSyslog()
          Returns the logger.
 AsynchronousReference getTail()
          Returns the tail of this asynchronous reference pair.
 java.lang.String toString()
           
 
Methods inherited from class mandala.rami.AbstractAsynchronousReference
call, setSyslog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface mandala.rami.AsynchronousReference
call
 

Field Detail

head

protected AsynchronousReference head
Constructor Detail

AsynchronousReferencePairImpl

protected AsynchronousReferencePairImpl(AsynchronousReference head,
                                        CallbackManager callbackManager)

Creates a new AsynchronousReferencePairImpl instance.

The caller must ensure that head.getObject() == tail, otherwise, the behaviour of the created instance is undefined !

Parameters:
head - an AsynchronousReference value
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

getCallbackManager

public CallbackManager getCallbackManager()
Description copied from interface: AsynchronousReference

Returns the CallbackManager of this instance.

Specified by:
getCallbackManager in interface AsynchronousReference
Overrides:
getCallbackManager in class AbstractAsynchronousReference

getObject

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

Returns the object this Reference refers to.

Specified by:
getObject in interface Reference
Returns:
the object this Reference refers to.

getHead

public AsynchronousReference getHead()
Description copied from interface: AsynchronousReferencePair

Returns the head of this asynchronous reference pair.

Specified by:
getHead in interface AsynchronousReferencePair
Returns:
Returns the head of this asynchronous reference pair

getTail

public AsynchronousReference getTail()
Description copied from interface: AsynchronousReferencePair

Returns the tail of this asynchronous reference pair.

Specified by:
getTail in interface AsynchronousReferencePair
Returns:
Returns the tail of this asynchronous reference pair

toString

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

getSyslog

public static Syslog getSyslog()
Description copied from class: AbstractAsynchronousReference

Returns the logger.


getInstance

public static AsynchronousReferencePairImpl getInstance(AsynchronousReference head,
                                                        CallbackManager callbackManager)

Gets the AsynchronousReferencePairImpl instance which handles reflexive asynchronous method invocation on the specified pair of asynchronous reference.

This class implements the singleton design pattern. If the related instance doesn't exist, it is created.

Parameters:
head - the head of the pair of asynchronous reference to handle reflexive asynchronous method invocation onto.
Returns:
the AsynchronousReferencePairImpl instance which handles reflexive asynchronous method invocation on the pair of asynchronous references.


Mandala help mailing list