|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.uwyn.rife.continuations.ContinuationManager<T>
public class ContinuationManager<T extends ContinuableObject>
Manages a collection of ContinuationContext instances.
A ContinuationManager instance is typically associated with
a specific context, like for example a Site
for RIFE's web engine. It's up to you to provide an API to your users if
you want them to be able to interact with the appropriate continuations
manager. For instance, in RIFE, to gain access to the
ContinuationManager of an active
instance, the
following code can be used: ElementSupportgetElementInfo().getSite().getContinuationManager().
Your application or library will have to provide its own.
ContinuationManager| Constructor Summary | |
|---|---|
ContinuationManager(ContinuationConfigRuntime config)
Instantiates a new continuation manager and uses the default values for the continuations duration and purging. |
|
| Method Summary | |
|---|---|
void |
addContext(ContinuationContext<T> context)
Adds a particular ContinuationContext to this manager. |
ContinuationConfigRuntime |
getConfigRuntime()
Retrieves the runtime configuration that was provided to the manager at instantiation. |
ContinuationContext<T> |
getContext(String id)
Retrieves a ContinuationContext instance from this continuation
manager. |
boolean |
isExpired(ContinuationContext<T> context)
Checks if a particular continuation context is expired. |
void |
removeContext(String id)
Removes a ContinuationContext instance from this continuation
manager. |
ContinuationContext<T> |
resumeContext(String id)
Creates a new ContinuationContext from an existing one so that
the execution can be resumed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ContinuationManager(ContinuationConfigRuntime config)
config - the runtime configuration that will be used be this
manager| Method Detail |
|---|
public ContinuationConfigRuntime getConfigRuntime()
public boolean isExpired(ContinuationContext<T> context)
context - the context that needs to be verified
true if the continuation context is expired; and
false otherwise
RifeConfig.Engine.getContinuationDuration()public void addContext(ContinuationContext<T> context)
ContinuationContext to this manager.
context - the context that will be addedpublic void removeContext(String id)
ContinuationContext instance from this continuation
manager.
id - the unique string that identifies the
ContinuationContext instance that will be removedgetContext(java.lang.String)
public ContinuationContext<T> resumeContext(String id)
throws CloneNotSupportedException
ContinuationContext from an existing one so that
the execution can be resumed.
If the existing continuation context couldn't be found, no new one
can be created. However, if it could be found, the result of
ContinuationConfigRuntime.cloneContinuations(T) will determine
whether the existing continuation context will be cloned to create
the new one, or if its state will be reused.
The new continuation context will have its own unique ID.
id - the ID of the existing continuation context
ContinuationContext; or
null if the existing continuation context couldn't be found
CloneNotSupportedExceptionpublic ContinuationContext<T> getContext(String id)
ContinuationContext instance from this continuation
manager.
id - the unique string that identifies the
ContinuationContext instance that has to be retrieved
ContinuationContext instance that corresponds
to the provided identifier; or
null if the identifier isn't known by the continuation
manager.
removeContext(java.lang.String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||