Class CurrentTaskFuture.UpAllTheWay
java.lang.Object
org.glassfish.hk2.runlevel.internal.CurrentTaskFuture.UpAllTheWay
- All Implemented Interfaces:
CurrentTaskFuture.AllTheWay
- Enclosing class:
CurrentTaskFuture
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private final long
private CurrentTaskFuture.UpOneLevel
private boolean
private MultiException
private final CurrentTaskFuture
private int
private final List
<ServiceHandle<RunLevelListener>> private final Object
private final int
private boolean
private final List
<ServiceHandle<Sorter>> private final boolean
private int
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
UpAllTheWay
(int goingTo, CurrentTaskFuture future, List<ServiceHandle<RunLevelListener>> listeners, List<ServiceHandle<Sorter>> sorters, int maxThreads, boolean useThreads, long cancelTimeout) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
cancel()
private void
currentJobComplete
(MultiException accumulatedExceptions) private void
go()
private void
setGoingTo
(int goingTo, boolean repurposed) waitForResult
(long timeout, TimeUnit unit) The method to call on the internal job
-
Field Details
-
lock
-
goingTo
private int goingTo -
maxThreads
private final int maxThreads -
useThreads
private final boolean useThreads -
future
-
listeners
-
sorters
-
cancelTimeout
private final long cancelTimeout -
workingOn
private int workingOn -
currentJob
-
cancelled
private boolean cancelled -
done
private boolean done -
repurposed
private boolean repurposed -
exception
-
-
Constructor Details
-
UpAllTheWay
private UpAllTheWay(int goingTo, CurrentTaskFuture future, List<ServiceHandle<RunLevelListener>> listeners, List<ServiceHandle<Sorter>> sorters, int maxThreads, boolean useThreads, long cancelTimeout)
-
-
Method Details
-
cancel
private void cancel() -
waitForResult
public Boolean waitForResult(long timeout, TimeUnit unit) throws InterruptedException, MultiException Description copied from interface:CurrentTaskFuture.AllTheWay
The method to call on the internal job- Specified by:
waitForResult
in interfaceCurrentTaskFuture.AllTheWay
- Parameters:
timeout
- The amount of time to wait for a resultunit
- The unit of the above time value- Returns:
- True if the job finished, False if the timeout is up prior to the job finishing, and null if the job was repurposed and the caller may now need to listen on a different job
- Throws:
InterruptedException
- On a thread getting jackedMultiException
- Other exceptions
-
setGoingTo
private void setGoingTo(int goingTo, boolean repurposed) -
go
private void go() -
currentJobComplete
-