edu.vub.at.eval
Class InvocationStack

java.lang.Object
  extended byedu.vub.at.eval.InvocationStack
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public final class InvocationStack
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

An InvocationStack instance represents the stack of method invocations and function applications that are currently activated in an actor's thread. It is mainly used for debugging purposes (e.g. generating stack trace information)

Author:
tvc
See Also:
Serialized Form

Nested Class Summary
private static class InvocationStack.InvocationFrame
           
 
Field Summary
private static java.lang.ThreadLocal _INVOCATION_STACK_
          A thread-local variable is used to assign a unique invocation stack to each separate actor.
private  java.util.Stack invocationStack_
           
 
Constructor Summary
private InvocationStack()
           
private InvocationStack(java.util.Stack initstack)
           
 
Method Summary
static InvocationStack captureInvocationStack()
           
 java.lang.Object clone()
           
 void funcallReturned(ATObject result)
           
 void functionCalled(ATExpression funCall, ATClosure fun, ATTable evaluatedArgs)
           
static InvocationStack getInvocationStack()
           
 void methodInvoked(ATExpression methodInvocation, ATObject receiver, ATMessage message)
           
 void methodReturned(ATObject result)
           
 void printStackTrace(java.io.PrintStream s)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_INVOCATION_STACK_

private static final java.lang.ThreadLocal _INVOCATION_STACK_
A thread-local variable is used to assign a unique invocation stack to each separate actor. Each actor that invokes the getInvocationStack() method receives its own separate copy of the invocation stack


invocationStack_

private final java.util.Stack invocationStack_
Constructor Detail

InvocationStack

private InvocationStack()

InvocationStack

private InvocationStack(java.util.Stack initstack)
Method Detail

getInvocationStack

public static final InvocationStack getInvocationStack()

captureInvocationStack

public static final InvocationStack captureInvocationStack()

methodInvoked

public void methodInvoked(ATExpression methodInvocation,
                          ATObject receiver,
                          ATMessage message)
                   throws InterpreterException
Throws:
InterpreterException

functionCalled

public void functionCalled(ATExpression funCall,
                           ATClosure fun,
                           ATTable evaluatedArgs)

methodReturned

public void methodReturned(ATObject result)
Parameters:
result - if null, the method invocation was aborted via an exception

funcallReturned

public void funcallReturned(ATObject result)
Parameters:
result - if null, the function call was aborted via an exception

printStackTrace

public void printStackTrace(java.io.PrintStream s)

clone

public java.lang.Object clone()