Class RequestOperationContextHolder


  • public class RequestOperationContextHolder
    extends java.lang.Object
    Singleton object which holds scope contexts specific to thread tree
    • Method Detail

      • initializeContext

        public void initializeContext()
        Initializes new request operation context and binds it to current thread. If any other context is already bound with current thread, thread detaches from it (see detachFromContext()).
      • detachFromContext

        public void detachFromContext()
        Disjoints operation performed by current thread from scope context prepared earlier by calling prepareForOperation(). Method should be called in the operation's thread. If context is no longer used, then it is cleared and removed.
      • detachRequestThreadFromContext

        protected void detachRequestThreadFromContext​(java.lang.Object requestId)
      • detachThreadFromContext

        protected void detachThreadFromContext​(java.lang.Thread thread)
      • hasContext

        public boolean hasContext()
        Checks if context for current thread is available
        Returns:
        true if there is a context correlated with this thread
        See Also:
        initializeContext()
      • getContext

        public RequestOperationContext getContext()
        Obtains a context for current thread if available, otherwise throws IllegalStateException
        Returns:
        context correlated with this thread
        See Also:
        initializeContext()