public class OperationHandleImpl<T extends Annotation> extends Object implements OperationHandle<T>
Modifier and Type | Method and Description |
---|---|
void |
closeOperation()
suspends this Operation on all threads where it is associated
and closes the operation.
|
boolean |
equals(Object o) |
Set<Long> |
getActiveThreads()
Gets a set of threads upon which this Operation is active
|
OperationIdentifier<T> |
getIdentifier()
Returns a unique identifier for this operation
|
Object |
getOperationData()
Gets arbitrary Operation data to be associated
with this Operation
|
OperationState |
getState()
Gets the current state of this operation
|
int |
hashCode() |
void |
resume()
Resumes this operation on the current thread.
|
void |
resume(long threadId)
Resumes this operation on the given thread id.
|
void |
setOperationData(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.
|
String |
toString() |
public OperationIdentifier<T> getIdentifier()
OperationHandle
getIdentifier
in interface OperationHandle<T extends Annotation>
public OperationState getState()
OperationHandle
getState
in interface OperationHandle<T extends Annotation>
public Set<Long> getActiveThreads()
OperationHandle
getActiveThreads
in interface OperationHandle<T extends Annotation>
public void suspend(long threadId)
OperationHandle
suspend
in interface OperationHandle<T extends Annotation>
threadId
- The thread on which to suspend this operationpublic void suspend()
OperationHandle
suspend
in interface OperationHandle<T extends Annotation>
public void resume(long threadId) throws IllegalStateException
OperationHandle
resume
in interface OperationHandle<T extends Annotation>
threadId
- The thread on which to resume this operationIllegalStateException
- if the Operation is closed or
if the given thread is associated with a different Operation
of the same typepublic void resume() throws IllegalStateException
OperationHandle
resume
in interface OperationHandle<T extends Annotation>
IllegalStateException
- if the Operation is closed or
if the current thread is associated with a different Operation
of the same typepublic void closeOperation()
OperationHandle
closeOperation
in interface OperationHandle<T extends Annotation>
public Object getOperationData()
OperationHandle
getOperationData
in interface OperationHandle<T extends Annotation>
public void setOperationData(Object data)
OperationHandle
setOperationData
in interface OperationHandle<T extends Annotation>
data
- (possibly null) data that
is associated with this OperationCopyright © 2009-2017, Oracle and/or its affiliates. All Rights Reserved.