|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectmandala.rami.AbstractAsynchronousReference
mandala.jacob.StoredObjectReference
Convenience class for stored object manipulation.
In a set of active maps, a reference to a stored
object is a pair (activeMap, key). An instance of this class
represents such a reference.
Instanciating a StoredObjectReference doesn't mean mapping
an object in an active map.
Moreover, this class implements the singleton design
pattern. For any pair (activeMap, key), only one instance
of this class exist in the JVM. So, getting a reference of an instance of
this class is done by the call :
whereStoredObjectReference storedObjectReference = StoredObjectReference.getInstance(activeMap, key)
activeMap is the active map reference
where an object is already mapped to key.
An instance of this class may be unusable if its related stored object
has been removed or doesn't exist. In such a case the reference represented
by the pair (activeMap, key) is called
invalid.
Each instance of this class uses the Syslog facility for
logging.
ActiveMap,
AsynchronousReference,
FutureFactory,
CallbackManager,
Syslog,
Serialized Form| Field Summary | |
protected ActiveMap |
activeMap
The active map reference where the stored object is mapped to key. |
protected FutureFactory |
futureFactory
The FutureFactory instance used to create our
future objects. |
protected Object |
key
The key of the mapped object. |
| Fields inherited from class mandala.rami.AbstractAsynchronousReference |
callbackManager, syslog |
| Constructor Summary | |
protected |
StoredObjectReference(ActiveMap activeMap,
Object key,
CallbackManager callbackManager,
FutureFactory futureFactory)
Creates a new StoredObjectReference instance. |
| Method Summary | |
FutureClient |
call(MethodOp method,
Object[] args,
Callback callback)
Call a method asynchronously. |
Object |
get()
Gets the object this reference refers to. |
ActiveMap |
getActiveMap()
Gets the active map this reference is linked to. |
FutureFactory |
getFutureFactory()
Returns the factory used to construct futures. |
static Object |
getGlobalUniqueKey(ActiveMap activeMap,
Object object)
|
static StoredObjectReference |
getInstance(ActiveMap activeMap,
Object key,
CallbackManager callbackManager,
FutureFactory futureFactory)
Gets the instance related to the pair (activeMap,
key). |
Object |
getKey()
Gets the key this reference is linked to. |
Object |
getObject()
Returns the object this StoredObjectReference refers
to. |
boolean |
isValid()
|
Object |
put(Object object)
Replace the stored object by a new one. |
Object |
remove()
Unmmap the stored object from its key in the active map. |
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 |
protected Object key
The key of the mapped object.
ActiveMapprotected ActiveMap activeMap
The active map reference where the stored object is mapped to key.
ActiveMapprotected FutureFactory futureFactory
The FutureFactory instance used to create our
future objects.
FutureFactory| Constructor Detail |
protected StoredObjectReference(ActiveMap activeMap,
Object key,
CallbackManager callbackManager,
FutureFactory futureFactory)
Creates a new StoredObjectReference instance.
activeMap - the active map where the stored
object resideskey - the key of the stored objectfutureFactory - the builder of future objectscallbackManager - the manager of
Callback for this instance.ActiveMap,
FutureFactory,
Callback| Method Detail |
public FutureClient call(MethodOp method,
Object[] args,
Callback callback)
AsynchronousReferenceCall a method asynchronously.
Since the call is asynchronous, exceptions are not handled in an
usual way. Implementations may 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.
call in interface AsynchronousReferencecall in class AbstractAsynchronousReferencepublic Object getObject()
Returns the object this StoredObjectReference refers
to.
This implementation of the
AsynchronousReference.getObject() method returns the same
value as get().
StoredObjectReference refers to.Map.get(Object ket)public Object put(Object object)
Replace the stored object by a new one.
object - the object this reference must refer to.
public Object get()
Gets the object this reference refers to.
public Object remove()
Unmmap the stored object from its key in the active map.
This reference object is invalid upon the return of this method.
public boolean isValid()
public ActiveMap getActiveMap()
Gets the active map this reference is linked to.
public Object getKey()
Gets the key this reference is linked to.
public FutureFactory getFutureFactory()
Returns the factory used to construct futures.
public String toString()
toString in class AbstractAsynchronousReference
public static StoredObjectReference getInstance(ActiveMap activeMap,
Object key,
CallbackManager callbackManager,
FutureFactory futureFactory)
Gets the instance related to the pair (activeMap,
key).
This class implements the singleton design pattern. If the
related instance doesn't exist, it is created. If the related instance
exist, the futureFactory and the
callbackManager arguments are unused.
No call to active map's methods are done.
Future calls to the returned instance are unspecified if this
storedObjectReference is invalid i.e. if no object is
mapped to key in the specified activeMap.
activeMap - the active map where the stored
object resideskey - the key of the stored objectfutureFactory - the builder of future objectscallbackManager - the manager of
Callback for this instance.
StoredObjectReference instance which handles
reflexive asynchronous method invocation on the specified stored object
pair (activeMap, key).ActiveMap,
FutureFactory,
CallbackManager
public static Object getGlobalUniqueKey(ActiveMap activeMap,
Object object)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||