mandala.rami
Interface InvocationObserver

All Known Subinterfaces:
FutureClient, RemoteFutureClient, RemoteInvocationObserver
All Known Implementing Classes:
AbstractFutureClient, RemoteInvocationObserverProxy

public interface InvocationObserver

This interface defines the behavior an observer of an asynchronous method invocation must have.

This interface provides methods to poll the availability of the result or of the callee thread of the asynchronous call.

Some methods of this interface are safe related meaning the result they return is always valid. Others are unsafe related meaning the validity of their returned value depends on the availability of another result.

This interface provides informations available during the real execution of the specified method.

Version:
1.0
Author:
eipi
See Also:
InvocationInfo, MethodResult, InvocationEventsWaiter, FutureClient

Method Summary
 ThreadOp getCalleeThread()
          Deprecated. 

The usability of the callee thread depends on the asynchronous policy used by the AsynchronousReference implementation. For example, if a thread-pool is used, the callee thread returned may be running a completely different method than the one called. Hence, callee thread use is error prone. No replacement. Current implementations always return null. This method will be removed in the next light release.

 boolean isCalleeAvailable()
          Deprecated. 

The usability of the callee thread depends on the asynchronous policy used by the AsynchronousReference implementation. For example, if a thread-pool is used, the callee thread returned may be running a completely different method than the one called. Hence, callee thread use is error prone. No replacement. Current implementations always return null. This method will be removed in the next light release.

 boolean isCancelled()
          Returns true if the asynchronous method invocation has been cancelled.
 boolean isInterrupted()
          Returns true if the asynchronous method invocation has been interrupted.
 boolean isResultAvailable()
          Test the usable value of the returned result.
 boolean isStarted()
          Returns true if the asynchronous method invocation is started.
 

Method Detail

isResultAvailable

public boolean isResultAvailable()

Test the usable value of the returned result. This method is safe related.

While the result is unavailable, this method returns false and calls to some methods of this class is undefined as specified in their documentation.

Returns:
true if the result is available

isCalleeAvailable

public boolean isCalleeAvailable()
Deprecated. 

The usability of the callee thread depends on the asynchronous policy used by the AsynchronousReference implementation. For example, if a thread-pool is used, the callee thread returned may be running a completely different method than the one called. Hence, callee thread use is error prone. No replacement. Current implementations always return null. This method will be removed in the next light release.

Test the usable value of the callee thread. This method is safe related.

While the callee thread as not yet been set by the implementation of asynchronous method invocation, this method returns false. Otherwise, it returns true.

This method may return true whereas getCalleeThread() returns a null value. This situation means that the callee has been set, has executed the method and is no longer available (it has died for example).

Returns:
true if the callee thread has been set by the implementation
See Also:
ResultUpdater.setCalleeThread(ThreadOp)

getCalleeThread

public ThreadOp getCalleeThread()
Deprecated. 

The usability of the callee thread depends on the asynchronous policy used by the AsynchronousReference implementation. For example, if a thread-pool is used, the callee thread returned may be running a completely different method than the one called. Hence, callee thread use is error prone. No replacement. Current implementations always return null. This method will be removed in the next light release.

Get the thread which is running the method invocation (the "callee"). This method is unsafe related.

While isCalleeAvailable() returns false, the value returned is undefined. Else, the ThreadOp instance referencing the thread which is running the method is returned which can be null if the method is considered terminated.

Returns:
the callee thread.
See Also:
ThreadOp

isStarted

public boolean isStarted()

Returns true if the asynchronous method invocation is started. This method is safe related

If this method returns false, then the asynchronous method invocation has not start its execution. Otherwise, the method may be currently running or terminated.

Returns:
true if this method has started its execution, false otherwise.

isCancelled

public boolean isCancelled()

Returns true if the asynchronous method invocation has been cancelled. This method is safe related

Returns:
a boolean value

isInterrupted

public boolean isInterrupted()

Returns true if the asynchronous method invocation has been interrupted. This method is safe related

Returns:
a boolean value


Mandala help mailing list