|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
net.sf.sapjcosupport.AsyncMethodCall
Utility class to execute a method call asynchronously.
This asynchronous method invoker uses a 'pull' mechanism to await completion.
The client code just calls Thread.start()
and
continues doing what it needs to do. When it is ready to wait for completion of the async method,
it calls waitForCompletion()
.
Field Summary |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
AsyncMethodCall()
|
Method Summary | |
protected abstract void |
executeMethod()
Implementation code of the method call. |
void |
run()
This method is a subclassed Thread.run() method
that handles executing the actual method. |
void |
waitForCompletion()
Synchronization point for the asynchronous method. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public AsyncMethodCall()
Method Detail |
protected abstract void executeMethod()
This is the code that gets executed asynchronously, when Thread.start()
is called.
Thread.start()
public void run()
Thread.run()
method
that handles executing the actual method.
executeMethod()
,
Thread.start()
,
Thread.stop()
,
Thread.Thread(ThreadGroup,
Runnable, String)
,
Runnable.run()
public void waitForCompletion()
Call this method when you are ready to wait for the async method to
complete its work. This method will block until executeMethod()
is finished
(which can be the case when this method is called, and it will return immediately...)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |