|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorc.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 | |
---|---|
boolean |
debugMode
|
static Globals<OrcEngine,java.lang.Object> |
globals
For debugging visualization |
protected boolean |
halt
This flag is set by the Execution region when execution completes to terminate the engine. |
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(java.lang.String s)
|
boolean |
deleteTmpdir(java.io.File directory)
Delete a temporary directory |
Config |
getConfig()
|
Execution |
getExecution()
|
boolean |
isDead()
|
void |
print(java.lang.String string,
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(Node root)
Run Orc given a root node. |
void |
scheduleTimer(java.util.TimerTask task,
long delay)
Schedule a timed task (used by Rtimer). |
void |
start(Node root)
|
protected boolean |
step()
Run one step (process one token or handle one site response) Return false if engine should halt. |
void |
terminate()
Terminate execution. |
void |
tokenError(TokenException problem)
A token owned by this engine has encountered an exception. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public boolean debugMode
protected boolean halt
public static final Globals<OrcEngine,java.lang.Object> globals
Constructor Detail |
---|
public OrcEngine(Config config)
Method Detail |
---|
public boolean isDead()
public void run()
run
in interface java.lang.Runnable
public void terminate()
public void run(Node root)
root
- node to runpublic void start(Node root)
protected boolean step()
public void activate(Token t)
t
- the token to be addedpublic void resume(Token t)
t
- the token to be addedpublic void publish(java.lang.Object v)
v
- public void tokenError(TokenException problem)
public void debug(java.lang.String s)
public void reportRound()
public void print(java.lang.String string, boolean newline)
Token.print(String, boolean)
public void scheduleTimer(java.util.TimerTask task, long delay)
public java.lang.String addGlobal(java.lang.Object value)
public Config getConfig()
public Execution getExecution()
public java.io.File createTmpdir() throws java.io.IOException
java.io.IOException
public boolean deleteTmpdir(java.io.File directory)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |