@Dependent public class ConcurrentExecutionTracker extends Object
The method being tracked needs to call executionStarted()
when it
starts and executionEnded()
when it's about to end.
try { tracker.executionStarted(); // whatever the method is meant to do } finally { tracker.executionEnded() }
Another method can then call waitForRunningExecutions(int)
to wait
for the expected number of executions to start.
Constructor and Description |
---|
ConcurrentExecutionTracker() |
Modifier and Type | Method and Description |
---|---|
void |
executionEnded() |
void |
executionStarted() |
void |
waitForRunningExecutions(int executions)
Wait for the given number of method executions to be running
|
public void waitForRunningExecutions(int executions)
This method will wait three seconds before returning an exception
executions
- number of executionspublic void executionStarted()
public void executionEnded()
Copyright © 2020 Eclipse Foundation. All rights reserved.