@Singleton public class OperationManagerImpl extends java.lang.Object implements OperationManager
Modifier and Type | Field and Description |
---|---|
private java.util.HashMap<java.lang.Class<? extends java.lang.annotation.Annotation>,SingleOperationManager<?>> |
children |
private ServiceLocator |
locator |
Constructor and Description |
---|
OperationManagerImpl() |
Modifier and Type | Method and Description |
---|---|
<T extends java.lang.annotation.Annotation> |
createAndStartOperation(T scope)
Creates an OperationHandle that will be associated
with the thread calling this method.
|
<T extends java.lang.annotation.Annotation> |
createOperation(T scope)
Creates an OperationHandle.
|
<T extends java.lang.annotation.Annotation> |
getCurrentOperation(T scope)
Gets the current operation of scope type on the current thread.
|
<T extends java.lang.annotation.Annotation> |
getCurrentOperations(T scope)
Gets a set of all Operations that are in state
OperationState.ACTIVE or OperationState.SUSPENDED . |
void |
shutdownAllOperations(java.lang.annotation.Annotation scope)
This method will suspend all currently open operations on all threads and
then close them.
|
private final java.util.HashMap<java.lang.Class<? extends java.lang.annotation.Annotation>,SingleOperationManager<?>> children
@Inject private ServiceLocator locator
public <T extends java.lang.annotation.Annotation> OperationHandle<T> createOperation(T scope)
OperationManager
AnnotationLiteral
createOperation
in interface OperationManager
scope
- The scope annotation for this operation typepublic <T extends java.lang.annotation.Annotation> OperationHandle<T> createAndStartOperation(T scope)
OperationManager
AnnotationLiteral
createAndStartOperation
in interface OperationManager
scope
- The scope annotation for this operation typepublic <T extends java.lang.annotation.Annotation> java.util.Set<OperationHandle<T>> getCurrentOperations(T scope)
OperationManager
OperationState.ACTIVE
or OperationState.SUSPENDED
.
Operations that are in the OperationState.CLOSED
state
are no longer tracked by the Manager.
The scope parameter is normally created with
AnnotationLiteral
getCurrentOperations
in interface OperationManager
scope
- The scope annotation for this operation typepublic <T extends java.lang.annotation.Annotation> OperationHandle<T> getCurrentOperation(T scope)
OperationManager
AnnotationLiteral
getCurrentOperation
in interface OperationManager
scope
- The scope annotation for this operation typepublic void shutdownAllOperations(java.lang.annotation.Annotation scope)
OperationManager
The scope parameter is normally created with
AnnotationLiteral
shutdownAllOperations
in interface OperationManager
scope
- The scope annotation for this operation type