org.apache.commons.javaflow.bytecode
Class StackRecorder

java.lang.Object
  extended by org.apache.commons.javaflow.bytecode.Stack
      extended by org.apache.commons.javaflow.bytecode.StackRecorder
All Implemented Interfaces:
Serializable

public final class StackRecorder
extends Stack

Adds additional behaviors necessary for stack capture/restore on top of Stack.

See Also:
Serialized Form

Field Summary
 boolean isCapturing
          True, is the continuation freeze the strack trace, and stops the continuation.
 boolean isRestoring
          True, if the continuation restores the previous stack trace to the last invocation of suspend().
 Object value
          Result object passed by the continuation to the client code during suspend
 
Fields inherited from class org.apache.commons.javaflow.bytecode.Stack
runnable
 
Constructor Summary
StackRecorder(Runnable pTarget)
          Creates a new empty StackRecorder that runs the given target.
StackRecorder(Stack pParent)
          Creates a clone of the given StackRecorder.
 
Method Summary
 StackRecorder execute(Object context)
           
static StackRecorder get()
          Return the continuation, which is associated to the current thread.
 Object getContext()
           
static Object suspend(Object value)
           
 
Methods inherited from class org.apache.commons.javaflow.bytecode.Stack
hasDouble, hasFloat, hasInt, hasLong, hasObject, hasReference, isEmpty, isSerializable, popDouble, popFloat, popInt, popLong, popObject, popReference, pushDouble, pushFloat, pushInt, pushLong, pushObject, pushReference, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

isRestoring

public transient boolean isRestoring
True, if the continuation restores the previous stack trace to the last invocation of suspend().

This field is accessed from the byte code injected into application code, and therefore defining a wrapper get method makes it awkward to step through the user code. That's why this field is public.


isCapturing

public transient boolean isCapturing
True, is the continuation freeze the strack trace, and stops the continuation.

See Also:
isRestoring

value

public transient Object value
Result object passed by the continuation to the client code during suspend

Constructor Detail

StackRecorder

public StackRecorder(Runnable pTarget)
Creates a new empty StackRecorder that runs the given target.


StackRecorder

public StackRecorder(Stack pParent)
Creates a clone of the given StackRecorder.

Method Detail

suspend

public static Object suspend(Object value)

execute

public StackRecorder execute(Object context)

getContext

public Object getContext()

get

public static StackRecorder get()
Return the continuation, which is associated to the current thread.



Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.