|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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 java.util.HashMap |
futureLevel
This table is needed for the NFE mechanism |
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 |
isNFE
Indicates if the returned object is a Non Functional Exception (thus the communication failed) |
protected static org.apache.log4j.Logger |
logger
Get NFE logger |
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 | |
void |
clearHandlersLevel()
Clear the local map of handlers |
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()
|
java.lang.String |
getHandlerizableInfo()
Get information about the handlerizable object |
java.util.HashMap |
getHandlersLevel()
Give a reference to a local map of handlers |
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 |
setExceptionHandler(Handler handler,
java.lang.Class exception)
Set a new handler within the table of the Handlerizable Object |
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()
|
Handler |
unsetExceptionHandler(java.lang.Class exception)
Remove a handler from the table of the Handlerizable Object |
protected void |
unsetMigrationTag()
|
void |
waitFor()
Blocks the calling thread until the future object is available. |
void |
waitFor(long timeout)
Blocks the calling thread until the future object is available or the timeout expires |
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
protected boolean isNFE
protected java.util.HashMap futureLevel
protected static org.apache.log4j.Logger logger
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)
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 void waitFor(long timeout) throws ProActiveException
waitFor
in interface Future
timeout
-
ProActiveException
- if the timeout expirespublic 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 ?).public java.lang.String getHandlerizableInfo() throws java.io.IOException
getHandlerizableInfo
in interface Handlerizable
java.io.IOException
public java.util.HashMap getHandlersLevel() throws java.io.IOException
getHandlersLevel
in interface Handlerizable
java.io.IOException
public void clearHandlersLevel() throws java.io.IOException
clearHandlersLevel
in interface Handlerizable
java.io.IOException
public void setExceptionHandler(Handler handler, java.lang.Class exception) throws java.io.IOException
setExceptionHandler
in interface Handlerizable
handler
- A handler associated with a class of non functional exception.exception
- A class of non functional exception. It is a subclass of NonFunctionalException
.
java.io.IOException
public Handler unsetExceptionHandler(java.lang.Class exception) throws java.io.IOException
unsetExceptionHandler
in interface Handlerizable
exception
- A class of non functional exception. It is a subclass of NonFunctionalException
.
java.io.IOException
protected void finalize()
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 |