| |
|
| org.apache.cocoon.components.flow.WebContinuation
WebContinuation | public class WebContinuation extends AbstractLogEnabled implements Comparable(Code) | | Representation of continuations in a Web environment.
Because a user may click on the back button of the browser and
restart a saved computation in a continuation, each
WebContinuation becomes the parent of a subtree of
continuations.
If there is no parent WebContinuation , the created
continuation becomes the root of a tree of
WebContinuation s.
author: Ovidiu Predescu since: March 19, 2002 version: CVS $Id: WebContinuation.java 433543 2006-08-22 06:22:54Z crossley $ |
children | protected List children(Code) | | The children continuations. These are continuations created by
resuming the processing from the point stored by
continuation .
|
continuation | protected Object continuation(Code) | | The continuation this object represents.
|
disposer | protected ContinuationsDisposer disposer(Code) | | Holds the ContinuationsDisposer to call when this continuation
gets invalidated.
|
id | protected String id(Code) | | The continuation id used to represent this instance in Web pages.
|
interpreterId | protected String interpreterId(Code) | | Interpreter id that this continuation is bound to
|
lastAccessTime | protected long lastAccessTime(Code) | | When was this continuation accessed last time. Each time the
continuation is accessed, this time is set to the time of the
access.
|
parentContinuation | protected WebContinuation parentContinuation(Code) | | The parent WebContinuation from which processing
last started. If null, there is no parent continuation
associated, and this is the first one to be created in a
processing. In this case this WebContinuation
instance becomes the root of the tree maintained by the
ContinuationsManager .
See Also: ContinuationsManager |
timeToLive | protected int timeToLive(Code) | | Indicates how long does this continuation will live (in
seconds). The continuation will be removed once the current time
is bigger than lastAccessTime + timeToLive .
|
userObject | protected Object userObject(Code) | | A user definable object. This is present for convenience, to
store any information associated with this
WebContinuation a particular implementation might
need.
|
WebContinuation | WebContinuation(String id, Object continuation, WebContinuation parentContinuation, int timeToLive, String interpreterId, ContinuationsDisposer disposer)(Code) | | Create a WebContinuation object. Saves the object in
the hash table of continuations maintained by
manager (this is done as a side effect of obtaining
and identifier from it).
Parameters: continuation - an Object value Parameters: parentContinuation - a WebContinuation value Parameters: timeToLive - time this continuation should live Parameters: disposer - a ContinuationsDisposer to call when thiscontinuation gets invalidated. |
compareTo | public int compareTo(Object other)(Code) | | Compares the expiration time of this instance with that of the
WebContinuation passed as argument.
Note: this class has a natural ordering that is
inconsistent with equals . .
Parameters: other - an Object value, which should be aWebContinuation instance an int value |
detachFromParent | public void detachFromParent()(Code) | | |
display | public void display()(Code) | | Debugging method.
Assumes the receiving instance as the root of a tree and
displays the tree of continuations.
|
display | protected String display(int depth)(Code) | | Debugging method.
Displays the receiving instance as if it is at the
indent depth in the tree of continuations. Each
level is indented 2 spaces.
Parameters: depth - an int value |
dispose | public void dispose()(Code) | | Dispose this continuation. Should be called on invalidation.
|
disposed | public boolean disposed()(Code) | | Return true if this continuation was disposed of
|
equals | public boolean equals(Object another)(Code) | | True if the identifiers are the same, false otherwise.
Parameters: another - an Object value a boolean value |
getAttribute | public Object getAttribute(String name)(Code) | | Get an attribute of this continuation
Parameters: name - the attribute name. |
getAttributeNames | public Enumeration getAttributeNames()(Code) | | Enumerate the attributes of this continuation.
an enumeration of strings |
getChildren | public List getChildren()(Code) | | Return the children WebContinuation which were
created as a result of resuming the processing from the current
continuation .
a List value |
getContinuation | public Object getContinuation()(Code) | | Return the continuation object.
an Object value |
getContinuation | public WebContinuation getContinuation(int level)(Code) | | Return the ancestor continuation situated level s
above the current continuation. The current instance is
considered to be at level 0. The parent continuation of the
receiving instance at level 1, its parent is at level 2 relative
to the receiving instance. If level is bigger than
the depth of the tree, the root of the tree is returned.
Parameters: level - an int value a WebContinuation value |
getDisposer | ContinuationsDisposer getDisposer()(Code) | | Obtains the ContinuationsDisposer to call when this continuation
is invalidated.
a ContinuationsDisposer instance or null if there areno specific clean-up actions required. |
getId | public String getId()(Code) | | Returns the string identifier of this
WebContinuation .
a String value |
getInterpreterId | public String getInterpreterId()(Code) | | Returns the string identifier of the interpreter to which
this WebContinuation is bound.
a String value |
getLastAccessTime | public long getLastAccessTime()(Code) | | Returns the last time this
WebContinuation was accessed.
a long value |
getParentContinuation | public WebContinuation getParentContinuation()(Code) | | Return the parent WebContinuation . Equivalent with
getContinuation(1) .
a WebContinuation value |
getTimeToLive | public long getTimeToLive()(Code) | | Returns the the timetolive for this
WebContinuation .
a long value |
getUserObject | public Object getUserObject()(Code) | | Obtains the user object associated with this instance.
an Object value |
hasExpired | public boolean hasExpired()(Code) | | Determines whether this continuation has expired
a boolean value |
hashCode | public int hashCode()(Code) | | Returns the hash code of the associated identifier.
an int value |
interpreterMatches | public boolean interpreterMatches(String interpreterId)(Code) | | |
removeAttribute | public void removeAttribute(String name)(Code) | | Remove an attribute of this continuation
Parameters: name - the attribute name |
setAttribute | public void setAttribute(String name, Object value)(Code) | | Set an attribute of this continuation
Parameters: name - the attribute name Parameters: value - its value |
setUserObject | public void setUserObject(Object obj)(Code) | | Sets the user object associated with this instance.
Parameters: obj - an Object value |
updateLastAccessTime | protected void updateLastAccessTime()(Code) | | Update the continuation in the
|
|
|
|