Package dev.restate.sdk
Interface ObjectContext
-
- All Superinterfaces:
Context,SharedObjectContext
- All Known Subinterfaces:
WorkflowContext
public interface ObjectContext extends SharedObjectContext
This interface can be used only within exclusive handlers of virtual objects. It extendsContextadding 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:
Context
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclear(dev.restate.sdk.common.StateKey<?> key)Clears the state stored under key.voidclearAll()Clears all the state of this virtual object instance key-value state storage<T> voidset(dev.restate.sdk.common.StateKey<T> key, @NonNull T value)Sets the given value under the given key, serializing the value using theSerdein theStateKey.-
Methods inherited from interface dev.restate.sdk.Context
awakeable, awakeableHandle, call, call, random, request, run, run, run, run, send, send, send, send, sleep, timer
-
Methods inherited from interface dev.restate.sdk.SharedObjectContext
get, key, stateKeys
-
-
-
-
Method Detail
-
clear
void clear(dev.restate.sdk.common.StateKey<?> key)
Clears the state stored under key.- Parameters:
key- identifying the state to clear.
-
clearAll
void clearAll()
Clears all the state of this virtual object instance key-value state storage
-
set
<T> void set(dev.restate.sdk.common.StateKey<T> key, @NonNull T value)Sets the given value under the given key, serializing the value using theSerdein theStateKey.- Parameters:
key- identifying the value to store and its type.value- to store under the given key. MUST NOT be null.
-
-