Interface ThreadLocalContextManager<C>


public interface ThreadLocalContextManager<C>
Manager for retrieving and storing a single object which represents all thread local state. Objects returned by this interface are opaque to callers and are entirely managed by the host application. These objects can be safely compared using Object.equals(Object).
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clear the thread local context on the current thread.
    Get the thread local context of the current thread.
    void
    Set the thread local context on the current thread.
  • Method Details

    • getThreadLocalContext

      C getThreadLocalContext()
      Get the thread local context of the current thread.
      Returns:
      The thread local context
    • setThreadLocalContext

      void setThreadLocalContext(C context)
      Set the thread local context on the current thread.
      Parameters:
      context - The context to set
      Throws:
      ClassCastException - if the given context is not an instance created via getThreadLocalContext().
    • clearThreadLocalContext

      void clearThreadLocalContext()
      Clear the thread local context on the current thread.