@Contract public interface OperationManager
Operations are categorized by the Annotation type. The annotation type corresponds
to the annotation class used in the extension of the OperationContext
which
defines the scope of the Operation. Most of the methods for this service take an
implementation of that annotation class, which is usually implemented by extending
AnnotationLiteral
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.
|
<T extends java.lang.annotation.Annotation> OperationHandle<T> createOperation(T scope)
AnnotationLiteral
scope
- The scope annotation for this operation type<T extends java.lang.annotation.Annotation> OperationHandle<T> createAndStartOperation(T scope)
AnnotationLiteral
scope
- The scope annotation for this operation typejava.lang.IllegalStateException
- if the current thread is
associated with a different Operation of the same type<T extends java.lang.annotation.Annotation> java.util.Set<OperationHandle<T>> getCurrentOperations(T scope)
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
scope
- The scope annotation for this operation type<T extends java.lang.annotation.Annotation> OperationHandle<T> getCurrentOperation(T scope)
AnnotationLiteral
scope
- The scope annotation for this operation typevoid shutdownAllOperations(java.lang.annotation.Annotation scope)
The scope parameter is normally created with
AnnotationLiteral
scope
- The scope annotation for this operation type