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 booleanprivate final longprivate CurrentTaskFuture.UpOneLevelprivate booleanprivate MultiExceptionprivate final CurrentTaskFutureprivate intprivate final List<ServiceHandle<RunLevelListener>> private final Objectprivate final intprivate booleanprivate final List<ServiceHandle<Sorter>> private final booleanprivate int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateUpAllTheWay(int goingTo, CurrentTaskFuture future, List<ServiceHandle<RunLevelListener>> listeners, List<ServiceHandle<Sorter>> sorters, int maxThreads, boolean useThreads, long cancelTimeout) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcancel()private voidcurrentJobComplete(MultiException accumulatedExceptions) private voidgo()private voidsetGoingTo(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.AllTheWayThe method to call on the internal job- Specified by:
waitForResultin 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
-