Package com.tick42.glue.core.contexts
Interface SharedContexts
-
public interface SharedContextsShared contexts.- See Also:
GlueApplication.contexts()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Collection<String>names()The names of all shared context.default CompletionStage<Context<Map<String,Object>>>subscribe(String name)Subscribes to a shared context with specified name.<T> CompletionStage<Context<T>>subscribe(String name, ReifiedType<T> type, T defaultData)default CompletionStage<Context<Map<String,Object>>>subscribe(String name, Map<String,Object> defaultValue)CompletionStage<Void>update(String name, Map<String,Object> delta)Updates a shared context with specified name by applying a delta.CompletionStage<Void>updatePaths(String name, Map<String,Object> deltaPaths)Update context data with specified delta.
-
-
-
Method Detail
-
names
Collection<String> names()
The names of all shared context.- Returns:
- names of all shared context
-
subscribe
<T> CompletionStage<Context<T>> subscribe(String name, ReifiedType<T> type, T defaultData)
-
subscribe
default CompletionStage<Context<Map<String,Object>>> subscribe(String name)
Subscribes to a shared context with specified name.- Parameters:
name- name of the shared context- Returns:
- stage that is completed when context is subscribed, never
null - Since:
- 1.2
-
subscribe
default CompletionStage<Context<Map<String,Object>>> subscribe(String name, Map<String,Object> defaultValue)
-
update
CompletionStage<Void> update(String name, Map<String,Object> delta)
Updates a shared context with specified name by applying a delta.- Parameters:
name- name of the shared contextdelta- changes to apply to the shared context- Returns:
- stage that is completed when context is updated, never
null - Since:
- 1.2
-
updatePaths
CompletionStage<Void> updatePaths(String name, Map<String,Object> deltaPaths)
Update context data with specified delta. Allows you to use "paths" in the structure to update/remove nested properties.- Parameters:
name- name of the shared contextdeltaPaths- changes to apply to the shared context- Returns:
- stage that is completed when context is updated, never
null - Since:
- 1.3.9
-
-