mandala.jacob.remote.gpf
Class RemoteInvocationEventsWaiterProxy

java.lang.Object
  extended bymandala.jacob.remote.AbstractRemote
      extended bymandala.jacob.remote.gpf.AbstractRemoteProxy
          extended bymandala.jacob.remote.gpf.RemoteInvocationEventsWaiterProxy
All Implemented Interfaces:
InvocationEventsWaiter, Remote, RemoteInvocationEventsWaiter, java.io.Serializable

public abstract class RemoteInvocationEventsWaiterProxy
extends AbstractRemoteProxy
implements RemoteInvocationEventsWaiter

Generic proxy for remote InvocationEventsWaiter implementation.

Since:
1.0
Version:
$Revision: 1.4 $
Author:
eipi
See Also:
RemoteInvocationEventsWaiter, AbstractRemoteProxy, ExceptionHandler, Serialized Form

Nested Class Summary
 
Nested classes inherited from class mandala.jacob.remote.RemoteInvocationEventsWaiter
RemoteInvocationEventsWaiter.RemoteInvocationEventsWaiterMethods
 
Field Summary
 
Fields inherited from class mandala.jacob.remote.gpf.AbstractRemoteProxy
client, exporter
 
Fields inherited from class mandala.jacob.remote.AbstractRemote
defaultExceptionHandler, exceptionHandler, syslog
 
Constructor Summary
RemoteInvocationEventsWaiterProxy(Client client, Exporter exporter, ExceptionHandler exceptionHandler)
           
 
Method Summary
 ThreadOp waitForCalleeThread()
          Wait for the thread which is running the method invocation (the "callee") to be set.
 ThreadOp waitForCalleeThread(long timeout)
          Wait for the thread which is running the method invocation (the "callee") to be set for a specified amount of time.
 java.lang.Object waitForResult()
          Equivalent to waitForResult(Long.MAX_VALUE).
 java.lang.Object waitForResult(long timeout)
          Wait for the availability of the result of an asynchronous method invocation for a specified amount of time.
 void waitUntilCalleeAvailable()
          Wait until the callee thread become available.
 boolean waitUntilCalleeAvailable(long timeout)
          Wait until the callee thread become available for a specified amount of time.
 void waitUntilResultAvailable()
          Wait until the result become available.
 boolean waitUntilResultAvailable(long timeout)
          Wait until the result become available for a specified amount of time.
 void waitUntilStarted()
          Wait until the method is runned by a callee thread.
 boolean waitUntilStarted(long timeout)
          Wait until the method is runned by a callee thread.
 
Methods inherited from class mandala.jacob.remote.gpf.AbstractRemoteProxy
toString
 
Methods inherited from class mandala.jacob.remote.AbstractRemote
getDefaultExceptionHandler, getExceptionHandler, getSyslog, handleException, setDefaultExceptionHandler, setExceptionHandler, setSyslog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface mandala.jacob.remote.Remote
getExceptionHandler, setExceptionHandler
 

Constructor Detail

RemoteInvocationEventsWaiterProxy

public RemoteInvocationEventsWaiterProxy(Client client,
                                         Exporter exporter,
                                         ExceptionHandler exceptionHandler)
Method Detail

waitForResult

public java.lang.Object waitForResult()
                               throws java.lang.Throwable,
                                      java.lang.InterruptedException
Description copied from interface: InvocationEventsWaiter

Equivalent to waitForResult(Long.MAX_VALUE). This method is safe related.

Specified by:
waitForResult in interface InvocationEventsWaiter
Returns:
The object returned by the asynchronous method invocation.
Throws:
java.lang.InterruptedException - if the thread has been interrupted
java.lang.Throwable - the exception thrown by the asynchronous method invocation.

waitForResult

public java.lang.Object waitForResult(long timeout)
                               throws java.lang.Throwable,
                                      java.lang.InterruptedException,
                                      TimedOutException
Description copied from interface: InvocationEventsWaiter

Wait for the availability of the result of an asynchronous method invocation for a specified amount of time. This method is safe related.

If an exception occured during the call, it is thrown.

If the specified timeout expires, a TimedOutException is thrown.

Specified by:
waitForResult in interface InvocationEventsWaiter
Returns:
The object returned by the asynchronous method invocation.
Throws:
TimedOutException - if the specified timeout expires.
java.lang.Throwable - The exception thrown by the asynchronous method invocation.
java.lang.InterruptedException - if another thread has interrupted the current thread. The interrupted status of the current thread is cleared when this exception is thrown.

waitUntilResultAvailable

public void waitUntilResultAvailable()
                              throws java.lang.InterruptedException
Description copied from interface: InvocationEventsWaiter

Wait until the result become available. This method is safe related.

Specified by:
waitUntilResultAvailable in interface InvocationEventsWaiter
Throws:
java.lang.InterruptedException

waitUntilResultAvailable

public boolean waitUntilResultAvailable(long timeout)
                                 throws java.lang.InterruptedException
Description copied from interface: InvocationEventsWaiter

Wait until the result become available for a specified amount of time. This method is safe related.

If the result is not available, wait timeout before returning.

Specified by:
waitUntilResultAvailable in interface InvocationEventsWaiter
Parameters:
timeout - the maximum time to wait in milliseconds.
Returns:
true if the result is available, false if the timeout expires.
Throws:
java.lang.InterruptedException

waitUntilCalleeAvailable

public void waitUntilCalleeAvailable()
                              throws java.lang.InterruptedException
Description copied from interface: InvocationEventsWaiter

Wait until the callee thread become available. This method is safe related.

Specified by:
waitUntilCalleeAvailable in interface InvocationEventsWaiter
Throws:
java.lang.InterruptedException

waitUntilCalleeAvailable

public boolean waitUntilCalleeAvailable(long timeout)
                                 throws java.lang.InterruptedException
Description copied from interface: InvocationEventsWaiter

Wait until the callee thread become available for a specified amount of time. This method is safe related.

If the callee is not available, wait timeout before returning.

Specified by:
waitUntilCalleeAvailable in interface InvocationEventsWaiter
Parameters:
timeout - the maximum time to wait in milliseconds (0 means wait for ever).
Returns:
true if the callee thread is available, false if the timeout expires.
Throws:
java.lang.InterruptedException

waitForCalleeThread

public ThreadOp waitForCalleeThread()
                             throws java.lang.InterruptedException
Description copied from interface: InvocationEventsWaiter

Wait for the thread which is running the method invocation (the "callee") to be set. This method is safe related.

Specified by:
waitForCalleeThread in interface InvocationEventsWaiter
Returns:
the callee thread.
Throws:
java.lang.InterruptedException - if another thread has interrupted the current thread. The interrupted status of the current thread is cleared when this exception is thrown.

waitForCalleeThread

public ThreadOp waitForCalleeThread(long timeout)
                             throws TimedOutException,
                                    java.lang.InterruptedException
Description copied from interface: InvocationEventsWaiter

Wait for the thread which is running the method invocation (the "callee") to be set for a specified amount of time. This method is safe related.

If the callee has not yet been set, wait timeout before returning the result.

Specified by:
waitForCalleeThread in interface InvocationEventsWaiter
Parameters:
timeout - the maximum time to wait in milliseconds (0 means wait for ever).
Returns:
the callee thread.
Throws:
java.lang.InterruptedException - if another thread has interrupted the current thread. The interrupted status of the current thread is cleared when this exception is thrown.
TimedOutException

waitUntilStarted

public void waitUntilStarted()
                      throws java.lang.InterruptedException
Description copied from interface: InvocationEventsWaiter

Wait until the method is runned by a callee thread. This method is safe related.

Specified by:
waitUntilStarted in interface InvocationEventsWaiter
Throws:
java.lang.InterruptedException

waitUntilStarted

public boolean waitUntilStarted(long timeout)
                         throws java.lang.InterruptedException
Description copied from interface: InvocationEventsWaiter

Wait until the method is runned by a callee thread. This method is safe related.

If the invocation has not yet started, wait timeout before returning.

Specified by:
waitUntilStarted in interface InvocationEventsWaiter
Parameters:
timeout - the maximum time to wait in milliseconds.
Returns:
true if the result is available, false if the timeout expires.
Throws:
java.lang.InterruptedException


Mandala help mailing list