Package com.tick42.glue.core.contexts

# Interface SharedContexts

    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

    <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 context
      `delta` - 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 context
      `deltaPaths` - changes to apply to the shared context
    Returns:
      stage that is completed when context is updated, never `null`
    Since:
      1.3.9