Package com.tick42.glue.core.contexts
Interface SharedContexts
- All Known Implementing Classes:
Contexts
public interface SharedContexts
Shared contexts.
- See Also:
GlueApplication.contexts()
-
Method Summary
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 Details
-
names
Collection<String> names()The names of all shared context.- Returns:
- names of all shared context
-
subscribe
-
subscribe
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
-
update
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
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
-