Class SingleOperationManager<T extends Annotation>
java.lang.Object
org.glassfish.hk2.extras.operation.internal.SingleOperationManager<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private final OperationContext
<T> private static final String
private final ServiceLocator
private final HashMap
<OperationIdentifier<T>, OperationHandleImpl<T>> private final ActiveDescriptor
<?> private final Object
private final T
private long
private final HashMap
<Long, OperationHandleImpl<T>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate OperationIdentifierImpl
<T> (package private) void
associateWithThread
(long threadId, OperationHandleImpl<T> handle) OperationLock must be held(package private) void
closeOperation
(OperationHandleImpl<T> closeMe) Called with the operationLock held(package private) void
disassociateThread
(long threadId, OperationHandleImpl<T> toRemove) OperationLock must be held(package private) void
disposeAllOperationServices
(OperationHandleImpl<T> closeMe) Explicitly called WITHOUT the operationLock held to avoid any deadlock with the context lock(package private) Set
<OperationHandle<T>> OperationLock need NOT be held(package private) OperationHandleImpl
<T> getCurrentOperationOnThisThread
(long threadId) OperationLock must be held(package private) void
shutdown()
toString()
-
Field Details
-
ID_PREAMBLE
- See Also:
-
operationLock
-
scope
-
openScopes
private final HashMap<OperationIdentifier<T extends Annotation>,OperationHandleImpl<T extends Annotation>> openScopes -
threadToHandleMap
-
locator
-
context
-
scopedIdentifier
private long scopedIdentifier -
operationDescriptor
-
closed
private boolean closed
-
-
Constructor Details
-
SingleOperationManager
SingleOperationManager(T scope, ServiceLocator locator)
-
-
Method Details
-
allocateNewIdentifier
-
createOperation
-
closeOperation
Called with the operationLock held- Parameters:
closeMe
- The non-null operation to close
-
disposeAllOperationServices
Explicitly called WITHOUT the operationLock held to avoid any deadlock with the context lock- Parameters:
closeMe
- The non-null operation to close
-
associateWithThread
OperationLock must be held- Parameters:
threadId
- The threadId to associate with this handlehandle
- The handle to be associated with this thread
-
disassociateThread
OperationLock must be held- Parameters:
threadId
- The threadId to disassociate with this handle
-
getCurrentOperationOnThisThread
OperationLock must be held- Returns:
- The operation associated with the given thread
-
getCurrentOperationOnThisThread
OperationLock need NOT be held- Returns:
- The operation associated with the current thread
-
getAllOperations
Set<OperationHandle<T>> getAllOperations() -
shutdown
void shutdown() -
toString
-