|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.objectweb.proactive.core.body.future.FutureProxy
This proxy class manages the semantic of future objects
Proxy
,
Serialized FormField Summary | |
protected boolean |
continuation
To mark the proxy before sending this future by parameter or by result |
protected UniqueID |
creatorID
UniqueID of the body which create this future |
protected long |
ID
ID of the future In fact, the sequence number of the request that generate this future |
protected boolean |
isAvailable
This flag indicates the status of the future object |
protected boolean |
isException
Indicates if the returned object is an exception |
protected boolean |
migration
To mark the Proxy before migration Usually, the Proxy cannot be serialized if the result is not available (no automatic continuation) but if we migrate, we don't want to wait for the result |
static int |
RECYCLE_POOL_SIZE
The size of the pool we use for recycling FutureProxy objects. |
protected UniqueID |
senderID
Unique ID of the sender (in case of automatic continuation). |
protected java.lang.Object |
target
The object the proxy sends calls to |
Constructor Summary | |
FutureProxy()
As this proxy does not create a reified object (as opposed to BodyProxy for example), it is the noargs constructor that is usually called. |
|
FutureProxy(ConstructorCall c,
java.lang.Object[] p)
This constructor is provided for compatibility with other proxies. |
Method Summary | |
boolean |
equals(java.lang.Object obj)
|
protected void |
finalize()
|
static int |
futureLength(java.lang.Object future)
|
UniqueID |
getCreatorID()
To get the creatorID. |
static FutureEventProducer |
getFutureEventProducer()
Returns the FutureEventProducer that is responsible for the
FutureProxys of this VM. |
static FutureProxy |
getFutureProxy()
|
long |
getID()
To get the sequence id of this future. |
java.lang.Throwable |
getRaisedException()
Returns the result this future is for as an exception if an exception has been raised or null if the result is not an exception. |
java.lang.Object |
getResult()
Returns the result this future is for. |
boolean |
isAwaited()
Tests the status of the returned object |
static boolean |
isAwaited(java.lang.Object obj)
Tests if the object obj is awaited or not. |
void |
receiveReply(java.lang.Object obj)
Invoked by a thread of the skeleton that performed the service in order to tie the result object to the proxy. |
java.lang.Object |
reify(MethodCall c)
Blocks until the future object is available, then executes Call c on the now-available object.
|
void |
setContinuationTag()
|
void |
setCreatorID(UniqueID i)
To set the creatorID, ie the UniqueID of the body which create this future |
void |
setID(long l)
To set the sequence id of this future. |
protected void |
setMigrationTag()
|
void |
setResult(java.lang.Object o)
|
void |
setSenderID(UniqueID i)
To set the senderID, ie the UniqueID of the body that will send this future, in case of automatic continuation. |
void |
unsetContinuationTag()
|
protected void |
unsetMigrationTag()
|
void |
waitFor()
Blocks the calling thread until the future object is available. |
Methods inherited from class java.lang.Object |
clone, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int RECYCLE_POOL_SIZE
protected java.lang.Object target
protected boolean migration
protected boolean continuation
protected UniqueID creatorID
protected long ID
protected UniqueID senderID
protected boolean isAvailable
protected boolean isException
Constructor Detail |
public FutureProxy() throws ConstructionOfReifiedObjectFailedException
public FutureProxy(ConstructorCall c, java.lang.Object[] p) throws ConstructionOfReifiedObjectFailedException
Method Detail |
public static boolean isAwaited(java.lang.Object obj)
obj
is awaited or not. Always returns
false
if obj
is not a future object.
public static FutureProxy getFutureProxy()
public static FutureEventProducer getFutureEventProducer()
FutureEventProducer
that is responsible for the
FutureProxys of this VM. Listeners can register themselves here.
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public void receiveReply(java.lang.Object obj) throws java.io.IOException
receiveReply
in interface LocalFuture
java.io.IOException
public java.lang.Throwable getRaisedException()
getRaisedException
in interface Future
public java.lang.Object getResult()
getResult
in interface Future
public void setResult(java.lang.Object o)
public boolean isAwaited()
isAwaited
in interface Future
true
if the future object is NOT yet available, false
if it is.public void waitFor()
waitFor
in interface Future
public long getID()
Future
getID
in interface Future
public void setID(long l)
Future
setID
in interface Future
public void setCreatorID(UniqueID i)
Future
setCreatorID
in interface Future
public UniqueID getCreatorID()
Future
getCreatorID
in interface Future
public void setSenderID(UniqueID i)
Future
setSenderID
in interface Future
public java.lang.Object reify(MethodCall c) throws java.lang.reflect.InvocationTargetException
c
on the now-available object.
As future and process behaviors are mutually exclusive, we know that
the invocation of a method on a future objects cannot lead to wait-by
necessity. Thus, we can propagate all exceptions raised by this invocation
reify
in interface Proxy
c
- The MethodCall object corresponding to the method
java.lang.reflect.InvocationTargetException
- If the invokation of the method represented by the
Call
object c
on the reified object
throws an exception, this exception is thrown as-is here. The stub then
throws this exception to the calling thread after checking that it is
declared in the throws clause of the reified method. Otherwise, the stub
does nothing except print a message on System.err (or out ?).protected void finalize()
finalize
in class java.lang.Object
protected void setMigrationTag()
protected void unsetMigrationTag()
public void setContinuationTag()
public void unsetContinuationTag()
public static int futureLength(java.lang.Object future)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |