@Contract public interface OperationHandle<T extends java.lang.annotation.Annotation>
Modifier and Type | Method and Description |
---|---|
void |
closeOperation()
suspends this Operation on all threads where it is associated
and closes the operation.
|
java.util.Set<java.lang.Long> |
getActiveThreads()
Gets a set of threads upon which this Operation is active
|
OperationIdentifier<T> |
getIdentifier()
Returns a unique identifier for this operation
|
java.lang.Object |
getOperationData()
Gets arbitrary Operation data to be associated
with this Operation
|
OperationState |
getState()
Gets the current state of this operation
|
void |
resume()
Resumes this operation on the current thread.
|
void |
resume(long threadId)
Resumes this operation on the given thread id.
|
void |
setOperationData(java.lang.Object data)
Sets arbitrary Operation data to be associated
with this Operation
|
void |
suspend()
Suspends this operation on the current thread.
|
void |
suspend(long threadId)
Suspends this operation on the given thread id.
|
OperationIdentifier<T> getIdentifier()
OperationState getState()
java.util.Set<java.lang.Long> getActiveThreads()
void suspend(long threadId)
threadId
- The thread on which to suspend this operationvoid suspend()
void resume(long threadId) throws java.lang.IllegalStateException
threadId
- The thread on which to resume this operationjava.lang.IllegalStateException
- if the Operation is closed or
if the given thread is associated with a different Operation
of the same typevoid resume() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if the Operation is closed or
if the current thread is associated with a different Operation
of the same typevoid closeOperation()
java.lang.Object getOperationData()
void setOperationData(java.lang.Object data)
data
- (possibly null) data that
is associated with this Operation