Interface SharedObjectContext
- All Superinterfaces:
Context
- All Known Subinterfaces:
ObjectContext, SharedWorkflowContext, WorkflowContext
- All Known Implementing Classes:
FakeContext
Deprecated, for removal: This API element is subject to removal in a future version.
This interface can be used only within shared handlers of virtual objects. It extends
Context adding access to the virtual object instance key-value state storage.
NOTE: This interface MUST NOT be accessed concurrently since it can lead to different orderings of user actions, corrupting the execution of the invocation.
- See Also:
-
Method Summary
Modifier and TypeMethodDescription<T> Optional<T> Deprecated, for removal: This API element is subject to removal in a future version.key()Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.Gets all the known state keys for this virtual object instance.Methods inherited from interface Context
awakeable, awakeable, awakeableHandle, call, instantNow, invocationHandle, invocationHandle, invocationHandle, random, request, run, run, run, run, run, run, run, run, run, runAsync, runAsync, runAsync, runAsync, runAsync, runAsync, runAsync, runAsync, runAsync, send, send, signal, signal, sleep, timer, timer
-
Method Details
-
key
String key()Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- the key of this object
-
get
Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
key- identifying the state to get and its type.- Returns:
- an
Optionalcontaining the stored state deserialized or an emptyOptionalif not set yet. - Throws:
RuntimeException- when the state cannot be deserialized.
-
stateKeys
Collection<String> stateKeys()Deprecated, for removal: This API element is subject to removal in a future version.Gets all the known state keys for this virtual object instance.- Returns:
- the immutable collection of known state keys.
-
Context-parameter programming model is superseded by the reflection-based API. Rather than accepting aSharedObjectContextparameter, useRestate.state()andRestate.key()inside the handler. See the migration guide.