|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcsli.util.thread.AsynchResult
public class AsynchResult
Used for returning asynchronously from a function. TODO: use generics once we switch to Java 1.5 AsynchResult ar = x.asynchFunctionTakingLong(); _ResultType_ r = (_ResultType_)ar.waitForResult();
| Constructor Summary | |
|---|---|
AsynchResult()
|
|
| Method Summary | |
|---|---|
void |
addCallback(AsynchResultCallback cb)
Add a callback for this result. |
boolean |
hasResult()
True if the result is available, false otherwise. |
void |
release()
If the result hasn't been set yet, sets it to null and releases a client if it's waiting. |
void |
setResult(Object o)
Set the result, and unblock the client waiting for it. |
Object |
waitForResult()
Blocks until a result is available, and then returns it. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AsynchResult()
| Method Detail |
|---|
public Object waitForResult()
public void addCallback(AsynchResultCallback cb)
public boolean hasResult()
public void setResult(Object o)
IllegalStateException - if invoked twice on the same AsynchResultpublic void release()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||