public class ScriptResult
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.Object |
VOID
Special void object for script methods not returning a result.
|
Constructor and Description |
---|
ScriptResult()
Constructor of a pending execution.
|
ScriptResult(java.lang.Object result)
Constructor for a finished execution.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Throwable |
getException()
Get the exception stored within this result.
|
java.lang.Object |
getResult()
Get the result value stored.
|
boolean |
hasException()
Checks whether this result contains an exception.
|
boolean |
isReady()
Verify that this ScriptResult is processed.
|
void |
setException(java.lang.Throwable e)
Set an exception to be stored for this result.
|
void |
setResult(java.lang.Object result)
Set the result to be stored.
|
java.lang.String |
toString() |
void |
waitForResult()
Blocks execution until the execution result is ready.
|
void |
waitForResult(long timeout)
Blocks execution until the execution result is ready or the timeout is reached.
|
public static final java.lang.Object VOID
public ScriptResult()
public ScriptResult(java.lang.Object result)
result
- result of executionpublic final boolean isReady()
public final void waitForResult()
public final void waitForResult(long timeout)
isReady()
as
the timeout might have depleted.timeout
- the maximum time to wait in milliseconds.public final java.lang.Object getResult()
public final void setResult(java.lang.Object result)
result
- object to be storedpublic final void setException(java.lang.Throwable e)
e
- exception to be storedpublic final java.lang.Throwable getException()
public final java.lang.String toString()
toString
in class java.lang.Object
public final boolean hasException()