Class ContinuationManager
ContinuationContext instances.
A ContinuationManager instance is typically associated with
a specific context, like for example a Site
for RIFE2'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.
- Since:
- 1.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new continuation manager and uses the default values for the continuations duration and purging. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddContext(ContinuationContext context) Adds a particularContinuationContextto this manager.Retrieves the runtime configuration that was provided to the manager at instantiation.getContext(String id) Retrieves aContinuationContextinstance from this continuation manager.booleanisExpired(ContinuationContext context) Checks if a particular continuation context is expired.voidremoveContext(String id) Removes aContinuationContextinstance from this continuation manager.resumeContext(String id) Creates a newContinuationContextfrom an existing one so that the execution can be resumed.
-
Constructor Details
-
ContinuationManager
Instantiates a new continuation manager and uses the default values for the continuations duration and purging.- Parameters:
config- the runtime configuration that will be used be this manager- Since:
- 1.0
-
-
Method Details
-
getConfigRuntime
Retrieves the runtime configuration that was provided to the manager at instantiation.- Returns:
- this manager's runtime configuration
- Since:
- 1.0
-
isExpired
Checks if a particular continuation context is expired.- Parameters:
context- the context that needs to be verified- Returns:
trueif the continuation context is expired; andfalseotherwise- Since:
- 1.0
-
addContext
Adds a particularContinuationContextto this manager.- Parameters:
context- the context that will be added- Since:
- 1.0
-
removeContext
Removes aContinuationContextinstance from this continuation manager.- Parameters:
id- the unique string that identifies theContinuationContextinstance that will be removed- Since:
- 1.0
- See Also:
-
resumeContext
Creates a newContinuationContextfrom an existing one so that the execution can be resumed.If the existing continuation context couldn't be found, no new one is created. However, if it could be found, the result of
ContinuationConfigRuntime.cloneContinuations(java.lang.Object)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.
- Parameters:
id- the ID of the existing continuation context- Returns:
- the new
ContinuationContext; ornullif the existing continuation context couldn't be found - Throws:
CloneNotSupportedException- when the continuable couldn't be cloned- Since:
- 1.0
-
getContext
Retrieves aContinuationContextinstance from this continuation manager.- Parameters:
id- the unique string that identifies theContinuationContextinstance that has to be retrieved- Returns:
- the
ContinuationContextinstance that corresponds to the provided identifier; ornullif the identifier isn't known by the continuation manager. - Since:
- 1.0
- See Also:
-