Class CurrentTaskFuture.UpAllTheWay
- java.lang.Object
-
- org.glassfish.hk2.runlevel.internal.CurrentTaskFuture.UpAllTheWay
-
- All Implemented Interfaces:
CurrentTaskFuture.AllTheWay
- Enclosing class:
- CurrentTaskFuture
private class CurrentTaskFuture.UpAllTheWay extends java.lang.Object implements CurrentTaskFuture.AllTheWay
-
-
Field Summary
Fields Modifier and Type Field Description private booleancancelledprivate longcancelTimeoutprivate CurrentTaskFuture.UpOneLevelcurrentJobprivate booleandoneprivate MultiExceptionexceptionprivate CurrentTaskFuturefutureprivate intgoingToprivate java.util.List<ServiceHandle<RunLevelListener>>listenersprivate java.lang.Objectlockprivate intmaxThreadsprivate booleanrepurposedprivate java.util.List<ServiceHandle<Sorter>>sortersprivate booleanuseThreadsprivate intworkingOn
-
Constructor Summary
Constructors Modifier Constructor Description privateUpAllTheWay(int goingTo, CurrentTaskFuture future, java.util.List<ServiceHandle<RunLevelListener>> listeners, java.util.List<ServiceHandle<Sorter>> sorters, int maxThreads, boolean useThreads, long cancelTimeout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcancel()private voidcurrentJobComplete(MultiException accumulatedExceptions)private voidgo()private voidsetGoingTo(int goingTo, boolean repurposed)java.lang.BooleanwaitForResult(long timeout, java.util.concurrent.TimeUnit unit)The method to call on the internal job
-
-
-
Field Detail
-
lock
private final java.lang.Object lock
-
goingTo
private int goingTo
-
maxThreads
private final int maxThreads
-
useThreads
private final boolean useThreads
-
future
private final CurrentTaskFuture future
-
listeners
private final java.util.List<ServiceHandle<RunLevelListener>> listeners
-
sorters
private final java.util.List<ServiceHandle<Sorter>> sorters
-
cancelTimeout
private final long cancelTimeout
-
workingOn
private int workingOn
-
currentJob
private CurrentTaskFuture.UpOneLevel currentJob
-
cancelled
private boolean cancelled
-
done
private boolean done
-
repurposed
private boolean repurposed
-
exception
private MultiException exception
-
-
Constructor Detail
-
UpAllTheWay
private UpAllTheWay(int goingTo, CurrentTaskFuture future, java.util.List<ServiceHandle<RunLevelListener>> listeners, java.util.List<ServiceHandle<Sorter>> sorters, int maxThreads, boolean useThreads, long cancelTimeout)
-
-
Method Detail
-
cancel
private void cancel()
-
waitForResult
public java.lang.Boolean waitForResult(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, MultiExceptionDescription 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:
java.lang.InterruptedException- On a thread getting jackedMultiException- Other exceptions
-
setGoingTo
private void setGoingTo(int goingTo, boolean repurposed)
-
go
private void go()
-
currentJobComplete
private void currentJobComplete(MultiException accumulatedExceptions)
-
-