|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object orc.runtime.Token
public class Token
Representation of an active thread of execution. Tokens move over the node graph as they are executed. They contain an environment, and may belong to a group. They also preserve the call chain and contain a value to be passed to the next token.
Method Summary | |
---|---|
void |
activate()
|
Token |
bind(java.lang.Object f)
Push a new future onto the environment stack |
void |
delay(int delay)
|
void |
die()
Kill this token. |
Token |
enterClosure(Closure closure,
TokenContinuation publishContinuation)
Enter a closure by moving to a new node and environment, and setting the continuation for leaveClosure() . |
void |
error(TokenException problem)
|
Token |
fork()
Fork a token. |
Token |
fork(Group group,
Region region)
Fork a token with a specified group and region. |
OrcEngine |
getEngine()
|
Env<java.lang.Object> |
getEnvironment()
|
Group |
getGroup()
|
LogicalClock |
getLtimer()
Used for Ltimer .time(). |
Expression |
getNode()
|
Region |
getRegion()
|
java.lang.Object |
getResult()
|
SourceLocation |
getSourceLocation()
|
TokenTracer |
getTracer()
|
void |
leave()
Convenience method for node.leave(this); |
Token |
leaveClosure()
Leave a closure by returning to the continuation set by enterClosure(Closure, TokenContinuation) . |
java.lang.Object |
lookup(Argument var)
Lookup a variable in the environment |
Token |
move(Expression right)
Move to a node node |
void |
popHandler()
pop an exception frame off the stack: |
void |
popLtimer()
|
void |
print(java.lang.String string,
boolean newline)
Print something (for use by the print and println sites). |
void |
process()
If a token is alive, calls the node to perform the next action. |
void |
publish()
Publish a value to the top level. |
void |
pushHandler(Closure closure,
TokenContinuation handlerReturn)
|
void |
pushLtimer()
|
void |
requireCapability(java.lang.String name,
boolean ifNull)
|
void |
resume()
|
void |
resume(java.lang.Object object)
|
Token |
setGroup(Group group)
|
void |
setQuiescent()
|
Token |
setRegion(Region region)
Migrate the token from one region to another. |
Token |
setResult(java.lang.Object result)
|
void |
setSourceLocation(SourceLocation location)
|
void |
throwException(java.lang.Object exceptionValue)
|
void |
throwJavaException(TokenException problem)
|
void |
throwRuntimeException(TokenException problem)
|
void |
unsetQuiescent()
|
Token |
unwind()
Pop one value off of the environment stack. |
Token |
unwind(int width)
Pop values off of the environment stack. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public final void die()
public final void process()
public final Expression getNode()
public final Group getGroup()
public final Env<java.lang.Object> getEnvironment()
public final java.lang.Object getResult()
public final OrcEngine getEngine()
public final Region getRegion()
public final Token setResult(java.lang.Object result)
public final Token setGroup(Group group)
public final Token setRegion(Region region)
public final TokenTracer getTracer()
public final Token move(Expression right)
right
- the node to move to
public final Token enterClosure(Closure closure, TokenContinuation publishContinuation) throws StackLimitReachedError
leaveClosure()
.
StackLimitReachedError
public final Token leaveClosure()
enterClosure(Closure, TokenContinuation)
.
public void popHandler()
public void throwException(java.lang.Object exceptionValue) throws TokenLimitReachedError, TokenException
TokenLimitReachedError
TokenException
public void pushHandler(Closure closure, TokenContinuation handlerReturn)
public final Token bind(java.lang.Object f)
f
- future to push
public final Token unwind()
public final Token unwind(int width)
width
- number of bindings to leave
public final java.lang.Object lookup(Argument var)
var
- variable name
public final void activate()
public final void resume(java.lang.Object object)
public final void resume()
public final void error(TokenException problem)
public void throwRuntimeException(TokenException problem)
public void throwJavaException(TokenException problem)
public final void print(java.lang.String string, boolean newline)
public final void publish()
public final Token fork() throws TokenLimitReachedError
TokenLimitReachedError
fork(Group, Region)
public final Token fork(Group group, Region region) throws TokenLimitReachedError
TokenLimitReachedError
public final void setSourceLocation(SourceLocation location)
setSourceLocation
in interface Locatable
public final SourceLocation getSourceLocation()
getSourceLocation
in interface Located
public final void unsetQuiescent()
public final void setQuiescent()
public final void requireCapability(java.lang.String name, boolean ifNull) throws CapabilityException
CapabilityException
public final void delay(int delay)
public final void pushLtimer()
public final void popLtimer() throws SiteException
SiteException
public final LogicalClock getLtimer()
Ltimer
.time().
public void leave()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |