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 boolean
cancelled
private long
cancelTimeout
private CurrentTaskFuture.UpOneLevel
currentJob
private boolean
done
private MultiException
exception
private CurrentTaskFuture
future
private int
goingTo
private java.util.List<ServiceHandle<RunLevelListener>>
listeners
private java.lang.Object
lock
private int
maxThreads
private boolean
repurposed
private java.util.List<ServiceHandle<Sorter>>
sorters
private boolean
useThreads
private int
workingOn
-
Constructor Summary
Constructors Modifier Constructor Description 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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
cancel()
private void
currentJobComplete(MultiException accumulatedExceptions)
private void
go()
private void
setGoingTo(int goingTo, boolean repurposed)
java.lang.Boolean
waitForResult(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, 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:
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)
-
-