Interface Context

All Superinterfaces:
Executor, Serializable, Service

public interface Context extends Executor, Service
Abstracts away from the Vert.x Context object, enabling alternative strategies for associating state with the current reactive stream.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    An object that identifies something we store in the Vert.x local context, usually a Session or StatelessSession, but in principle anything at all.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    execute(Runnable runnable)
    Run the given command in a context.
    <T> T
    get(Context.Key<T> key)
    Get a value associated with the current reactive stream, or return null.
    <T> void
    put(Context.Key<T> key, T instance)
    Associate a value with the current reactive stream.
    void
    Remove a value associated with the current reactive stream.
  • Method Details

    • put

      <T> void put(Context.Key<T> key, T instance)
      Associate a value with the current reactive stream.
    • get

      <T> T get(Context.Key<T> key)
      Get a value associated with the current reactive stream, or return null.
    • remove

      void remove(Context.Key<?> key)
      Remove a value associated with the current reactive stream.
    • execute

      void execute(Runnable runnable)
      Run the given command in a context. If there is a context already associated with the call, use that one. Otherwise, create a new context and execute the command in the new context. In case a new context is created, it will ensure a local context is created.
      Specified by:
      execute in interface Executor