|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object orc.runtime.OrcEngine
public class OrcEngine
The Orc Engine provides the main loop for executing active tokens. Tokens are always processed in a single thread, but tokens might be activated or resumed from other threads, so some synchronization is necessary.
Field Summary | |
---|---|
static Globals<OrcEngine,java.lang.Object> |
globals
|
Constructor Summary | |
---|---|
OrcEngine(Config config)
|
Method Summary | |
---|---|
void |
activate(Token t)
Activate a token by adding it to the queue of active tokens |
java.lang.String |
addGlobal(java.lang.Object value)
|
java.io.File |
createTmpdir()
Create a new temporary directory and return the path to that directory. |
void |
debug(int level,
java.lang.String s)
Output some debugging information at the given level. |
boolean |
deleteTmpdir(java.io.File directory)
Delete a temporary directory |
Config |
getConfig()
|
Execution |
getExecution()
|
boolean |
isDead()
|
Token |
newExecution(Expression ex,
Token initiator)
Create a new toplevel token hosted by this engine. |
void |
onDebug(java.lang.String s)
Override this to change how debugging output is handled. |
void |
onError(TokenException problem)
Handle an error token. |
void |
onPublish(java.lang.Object v)
Handle a published value. |
void |
onTerminate()
Override this to customize termination. |
void |
pause()
Pause execution. |
void |
print(java.lang.String value,
boolean newline)
Print something (for use by the print and println sites). |
void |
publish(java.lang.Object v)
Publish a result. |
void |
reportRound()
|
void |
resume(Token t)
Activate a token by adding it to the queue of returning tokens |
void |
run()
Process active nodes, running indefinitely until signalled to stop by a call to terminate(). |
void |
run(Expression root)
Run Orc given a root node. |
void |
scheduleTimer(java.util.TimerTask task,
long delay)
Schedule a timed task (used by Rtimer). |
boolean |
shouldDebug(int level)
Return true if a debug report at the given level will be used. |
void |
start(Expression root)
|
void |
terminate()
Terminate execution. |
void |
tokenError(TokenException problem)
A token owned by this engine has encountered an exception. |
void |
unpause()
Unpause execution. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Globals<OrcEngine,java.lang.Object> globals
Constructor Detail |
---|
public OrcEngine(Config config)
Method Detail |
---|
public final boolean isDead()
public final void run()
run
in interface java.lang.Runnable
public final Token newExecution(Expression ex, Token initiator)
ex
- initiator
-
public void onTerminate()
public final void terminate()
public final void pause()
public final void unpause()
public final void run(Expression root)
start(root); run();
.
root
- node to runpublic final void start(Expression root)
public final void activate(Token t)
t
- the token to be addedpublic final void resume(Token t)
t
- the token to be addedpublic final void publish(java.lang.Object v)
v
- public void onPublish(java.lang.Object v)
public final void tokenError(TokenException problem)
public void onError(TokenException problem)
public final boolean shouldDebug(int level)
public final void debug(int level, java.lang.String s)
level
- s
- public void onDebug(java.lang.String s)
s
- public final void reportRound()
public void print(java.lang.String value, boolean newline)
Token.print(String, boolean)
public final void scheduleTimer(java.util.TimerTask task, long delay)
public final java.lang.String addGlobal(java.lang.Object value)
public final Config getConfig()
public final Execution getExecution()
public final java.io.File createTmpdir() throws java.io.IOException
java.io.IOException
public final boolean deleteTmpdir(java.io.File directory)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |