Module org.glassfish.hk2.extras
Class OperationHandleImpl<T extends Annotation>
java.lang.Object
org.glassfish.hk2.extras.operation.internal.OperationHandleImpl<T>
- All Implemented Interfaces:
Closeable,AutoCloseable,OperationHandle<T>
- Author:
- jwells
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Suspends this Operation on all threads where it is associated and closes the operation.voidSuspends this Operation on all threads where it is associated and closes the operation.booleanGets a set of threads upon which this Operation is activeReturns a unique identifier for this operationGets arbitrary Operation data to be associated with this OperationgetState()Gets the current state of this operationinthashCode()voidresume()Resumes this operation on the current thread.voidresume(long threadId) Resumes this operation on the given thread id.voidsetOperationData(Object data) Sets arbitrary Operation data to be associated with this Operationvoidsuspend()Suspends this operation on the current thread.voidsuspend(long threadId) Suspends this operation on the given thread id.toString()
-
Method Details
-
getIdentifier
Description copied from interface:OperationHandleReturns a unique identifier for this operation- Specified by:
getIdentifierin interfaceOperationHandle<T extends Annotation>- Returns:
- A non-null unique identifier for this operation
-
getState
Description copied from interface:OperationHandleGets the current state of this operation- Specified by:
getStatein interfaceOperationHandle<T extends Annotation>- Returns:
- The current state of this operation
-
getActiveThreads
Description copied from interface:OperationHandleGets a set of threads upon which this Operation is active- Specified by:
getActiveThreadsin interfaceOperationHandle<T extends Annotation>- Returns:
- The set of threads upon which this Operation is active
-
suspend
public void suspend(long threadId) Description copied from interface:OperationHandleSuspends this operation on the given thread id. If this Operation is not associated with the given threadId this method does nothing- Specified by:
suspendin interfaceOperationHandle<T extends Annotation>- Parameters:
threadId- The thread on which to suspend this operation
-
suspend
public void suspend()Description copied from interface:OperationHandleSuspends this operation on the current thread. If this Operation is not associated with the current threadId this method does nothing- Specified by:
suspendin interfaceOperationHandle<T extends Annotation>
-
resume
Description copied from interface:OperationHandleResumes this operation on the given thread id. If this Operation is already associated with the given threadId this method does nothing- Specified by:
resumein interfaceOperationHandle<T extends Annotation>- Parameters:
threadId- The thread on which to resume this operation- Throws:
IllegalStateException- if the Operation is closed or if the given thread is associated with a different Operation of the same type
-
resume
Description copied from interface:OperationHandleResumes this operation on the current thread. If this Operation is already associated with the current thread this method does nothing- Specified by:
resumein interfaceOperationHandle<T extends Annotation>- Throws:
IllegalStateException- if the Operation is closed or if the current thread is associated with a different Operation of the same type
-
close
public void close()Description copied from interface:OperationHandleSuspends this Operation on all threads where it is associated and closes the operation. All resume calls on this handle after this is called will throw IllegalStateException. If this handle is already closed this method does nothing- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceOperationHandle<T extends Annotation>
-
closeOperation
public void closeOperation()Description copied from interface:OperationHandleSuspends this Operation on all threads where it is associated and closes the operation. All resume calls on this handle after this is called will throw IllegalStateException. If this handle is already closed this method does nothing- Specified by:
closeOperationin interfaceOperationHandle<T extends Annotation>- See Also:
-
getOperationData
Description copied from interface:OperationHandleGets arbitrary Operation data to be associated with this Operation- Specified by:
getOperationDatain interfaceOperationHandle<T extends Annotation>- Returns:
- Arbitrary (possibly null) data that is associated with this Operation
-
setOperationData
Description copied from interface:OperationHandleSets arbitrary Operation data to be associated with this Operation- Specified by:
setOperationDatain interfaceOperationHandle<T extends Annotation>- Parameters:
data- (possibly null) data that is associated with this Operation
-
hashCode
public int hashCode() -
equals
-
toString
-