Class SingleOperationManager<T extends java.lang.annotation.Annotation>


  • public class SingleOperationManager<T extends java.lang.annotation.Annotation>
    extends java.lang.Object
    • Field Detail

      • operationLock

        private final java.lang.Object operationLock
      • scope

        private final T extends java.lang.annotation.Annotation scope
      • threadToHandleMap

        private final java.util.HashMap<java.lang.Long,​OperationHandleImpl<T extends java.lang.annotation.Annotation>> threadToHandleMap
      • context

        private final OperationContext<T extends java.lang.annotation.Annotation> context
      • scopedIdentifier

        private long scopedIdentifier
      • closed

        private boolean closed
    • Constructor Detail

      • SingleOperationManager

        SingleOperationManager​(T scope,
                               ServiceLocator locator)
    • Method Detail

      • closeOperation

        void closeOperation​(OperationHandleImpl<T> closeMe)
        Called with the operationLock held
        Parameters:
        closeMe - The non-null operation to close
      • disposeAllOperationServices

        void disposeAllOperationServices​(OperationHandleImpl<T> closeMe)
        Explicitly called WITHOUT the operationLock held to avoid any deadlock with the context lock
        Parameters:
        closeMe - The non-null operation to close
      • associateWithThread

        void associateWithThread​(long threadId,
                                 OperationHandleImpl<T> handle)
        OperationLock must be held
        Parameters:
        threadId - The threadId to associate with this handle
        handle - The handle to be associated with this thread
      • disassociateThread

        void disassociateThread​(long threadId,
                                OperationHandleImpl<T> toRemove)
        OperationLock must be held
        Parameters:
        threadId - The threadId to disassociate with this handle
      • getCurrentOperationOnThisThread

        OperationHandleImpl<T> getCurrentOperationOnThisThread​(long threadId)
        OperationLock must be held
        Returns:
        The operation associated with the given thread
      • getCurrentOperationOnThisThread

        public OperationHandleImpl<T> getCurrentOperationOnThisThread()
        OperationLock need NOT be held
        Returns:
        The operation associated with the current thread
      • shutdown

        void shutdown()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object