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
ConstructorDescriptionInstantiates a new continuation manager and uses the default values for the continuations duration and purging. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addContext
(ContinuationContext context) Adds a particularContinuationContext
to this manager.Retrieves the runtime configuration that was provided to the manager at instantiation.getContext
(String id) Retrieves aContinuationContext
instance from this continuation manager.boolean
isExpired
(ContinuationContext context) Checks if a particular continuation context is expired.void
removeContext
(String id) Removes aContinuationContext
instance from this continuation manager.resumeContext
(String id) Creates a newContinuationContext
from 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:
true
if the continuation context is expired; andfalse
otherwise- Since:
- 1.0
-
addContext
Adds a particularContinuationContext
to this manager.- Parameters:
context
- the context that will be added- Since:
- 1.0
-
removeContext
Removes aContinuationContext
instance from this continuation manager.- Parameters:
id
- the unique string that identifies theContinuationContext
instance that will be removed- Since:
- 1.0
- See Also:
-
resumeContext
Creates a newContinuationContext
from 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
; ornull
if the existing continuation context couldn't be found - Throws:
CloneNotSupportedException
- when the continuable couldn't be cloned- Since:
- 1.0
-
getContext
Retrieves aContinuationContext
instance from this continuation manager.- Parameters:
id
- the unique string that identifies theContinuationContext
instance that has to be retrieved- Returns:
- the
ContinuationContext
instance that corresponds to the provided identifier; ornull
if the identifier isn't known by the continuation manager. - Since:
- 1.0
- See Also:
-