Package xal.tools.dispatch
Class DispatchGroup
java.lang.Object
xal.tools.dispatch.DispatchGroup
DispatchGroup
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> void
addOperation
(xal.tools.dispatch.DispatchOperation<T> operation) add an operation to this groupstatic <T> void
addOperationToCurrentGroups
(xal.tools.dispatch.DispatchOperation<T> operation) add the operation to the current groupsstatic <T> void
addOperationToGroups
(xal.tools.dispatch.DispatchOperation<T> operation, Set<DispatchGroup> groups) add the operation to the specified groups<T> void
addOperationToThisGroupAndCurrentGroups
(xal.tools.dispatch.DispatchOperation<T> operation) add the operation to this group and the current groups without double counting this groupvoid
await()
synonym for waitForCompletion()void
await
(long timeout) synonym for waitForCompletionWithTimeout( timeout )void
enter()
Enter this group for addition of operations on the current threadprotected static Set<DispatchGroup>
Get the set of current groupsvoid
leave()
Leave this group to remove it from addition of operations on the current thread<T> void
operationCompleted
(xal.tools.dispatch.DispatchOperation<T> operation) Event indicating that an operation in this group has completedvoid
wait indefinitely for all operations to completevoid
waitForCompletionWithTimeout
(long timeout) wait at most the timeout for all operations to complete
-
Constructor Details
-
DispatchGroup
public DispatchGroup()
-
-
Method Details
-
getCurrentGroups
Get the set of current groups -
enter
public void enter()Enter this group for addition of operations on the current thread -
leave
public void leave()Leave this group to remove it from addition of operations on the current thread -
await
public void await()synonym for waitForCompletion() -
waitForCompletion
public void waitForCompletion()wait indefinitely for all operations to complete -
await
public void await(long timeout) synonym for waitForCompletionWithTimeout( timeout ) -
waitForCompletionWithTimeout
public void waitForCompletionWithTimeout(long timeout) wait at most the timeout for all operations to complete- Parameters:
timeout
- the maximum timeout in milliseconds to wait
-
addOperationToThisGroupAndCurrentGroups
public <T> void addOperationToThisGroupAndCurrentGroups(xal.tools.dispatch.DispatchOperation<T> operation) add the operation to this group and the current groups without double counting this group -
addOperationToCurrentGroups
public static <T> void addOperationToCurrentGroups(xal.tools.dispatch.DispatchOperation<T> operation) add the operation to the current groups -
addOperationToGroups
public static <T> void addOperationToGroups(xal.tools.dispatch.DispatchOperation<T> operation, Set<DispatchGroup> groups) add the operation to the specified groups -
addOperation
public <T> void addOperation(xal.tools.dispatch.DispatchOperation<T> operation) add an operation to this group -
operationCompleted
public <T> void operationCompleted(xal.tools.dispatch.DispatchOperation<T> operation) Event indicating that an operation in this group has completed
-