org.apache.cocoon.components.flow.java
Class Continuation

java.lang.Object
  extended by org.apache.cocoon.components.flow.java.Continuation

public class Continuation
extends Object

Continuation object to store the current execution. The continuation object can only used once.

Version:
CVS $Id: Continuation.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Stephan Michels, Torsten Curdt

Field Summary
 boolean capturing
           
 boolean restoring
           
 
Constructor Summary
Continuation(Continuation parent, Object context)
          Create a new continuation, which continue a previous continuation.
Continuation(String functionName, Object context)
          Create new continuation.
 
Method Summary
static Continuation currentContinuation()
          Return the continuation, which is associated to the current thread.
 void deregisterThread()
          Unbind the continuation to running thread.
 Object getContext()
          Return context object, which is associated to this continuation.
 String getFunctionName()
           
 ContinuationStack getStack()
          Return the stack, which is used to store the frame information.
 boolean isCapturing()
          True, if the continuation freezes the stack trace, and stops the continuation.
 boolean isRestoring()
          True, if the continuation restores the previous stack trace to the last invocation of suspend().
 void registerThread()
          Bind the continuation to running thread.
static void suspend()
          Suspend the running continuation or restore the suspended continuation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

restoring

public boolean restoring

capturing

public boolean capturing
Constructor Detail

Continuation

public Continuation(String functionName,
                    Object context)
Create new continuation.


Continuation

public Continuation(Continuation parent,
                    Object context)
Create a new continuation, which continue a previous continuation.

Method Detail

getFunctionName

public String getFunctionName()

getStack

public ContinuationStack getStack()
Return the stack, which is used to store the frame information.


getContext

public Object getContext()
Return context object, which is associated to this continuation.


suspend

public static void suspend()
Suspend the running continuation or restore the suspended continuation. With the help of byte code manipulation this method is run twice, once at the end of request 1 to suspend the continuation and a second time at the beginning of the request 2.


isRestoring

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


isCapturing

public boolean isCapturing()
True, if the continuation freezes the stack trace, and stops the continuation.


registerThread

public void registerThread()
Bind the continuation to running thread.


deregisterThread

public void deregisterThread()
Unbind the continuation to running thread.


currentContinuation

public static Continuation currentContinuation()
Return the continuation, which is associated to the current thread.



Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.