Top Description Inners Fields Constructors Methods
org.glassfish.hk2.runlevel.internal

public Class CurrentTaskFuture

extends Object
implements ChangeableRunLevelFuture
Class Inheritance
All Implemented Interfaces
org.glassfish.hk2.runlevel.ChangeableRunLevelFuture, org.glassfish.hk2.runlevel.RunLevelFuture, java.util.concurrent.Future
Imports
java.util.Collections, .HashSet, .List, .Timer, .TimerTask, java.util.concurrent.ExecutionException, .Executor, .TimeUnit, .TimeoutException, java.util.concurrent.locks.Condition, .ReentrantLock, org.glassfish.hk2.api.ActiveDescriptor, .Descriptor, .IndexedFilter, .Injectee, .MultiException, .ServiceHandle, .ServiceLocator, org.glassfish.hk2.runlevel.ChangeableRunLevelFuture, .ErrorInformation, .ProgressStartedListener, .RunLevel, .RunLevelListener, .Sorter, org.glassfish.hk2.runlevel.utilities.Utilities

This is the implementation of RunLevelFuture. There should only be one of these active in the system at any time. Of course users are given a handle to this object, so they can hold onto references to it for as long as they'd like.
Author
jwells

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static interface
private static class
private class
CurrentTaskFuture.DownAllTheWay

Goes down all the way to the proposed level

private static class
private static class
private static class
private class
private class

Field Summary

Modifier and TypeField and Description
private final List<ServiceHandle<RunLevelListener>>
private final List<ServiceHandle<ProgressStartedListener>>
private final List<ServiceHandle<Sorter>>
private final AsyncRunLevelContext
private boolean
private final long
private boolean
private CurrentTaskFuture.DownAllTheWay
private final Executor
private boolean
private final ServiceLocator
private final ReentrantLock
private final int
private int
private final Timer
private CurrentTaskFuture.UpAllTheWay
private final boolean

Constructor Summary

AccessConstructor and Description
pack-priv
CurrentTaskFuture(AsyncRunLevelContext asyncContext, Executor executor, ServiceLocator locator, int proposedLevel, int maxThreads, boolean useThreads, long cancelTimeout, Timer timer)

Method Summary

Modifier and TypeMethod and Description
public boolean
cancel(boolean mayInterruptIfRunning)

Implements org.glassfish.hk2.runlevel.RunLevelFuture.cancel.

The cancel method attempts to cancel the current running job (if the job is not already completed or already cancelled).

public int
changeProposedLevel(int proposedLevel)

Implements org.glassfish.hk2.runlevel.ChangeableRunLevelFuture.changeProposedLevel.

Changes the proposedLevel of this future.

public Object
get()

Implements java.util.concurrent.Future.get.

Waits if necessary for the computation to complete, and then retrieves its result.

public Object
get(long timeout, TimeUnit unit)

Implements java.util.concurrent.Future.get.

Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.

public int
getProposedLevel()

Implements org.glassfish.hk2.runlevel.RunLevelFuture.getProposedLevel.

This gets the level that this future job is attempting to get to

pack-priv void
go()

private void
go(CurrentTaskFuture.UpAllTheWay localUpAllTheWay, CurrentTaskFuture.DownAllTheWay localDownAllTheWay)

private static void
private static ErrorInformation
private void
private void
private static final boolean
public boolean
isCancelled()

Implements java.util.concurrent.Future.isCancelled.

Returns true if this task was cancelled before it completed normally.

public boolean
isDone()

Implements java.util.concurrent.Future.isDone.

Returns true if this task completed.

public boolean
isDown()

Implements org.glassfish.hk2.runlevel.RunLevelFuture.isDown.

Returns true if this job represents the system going from a higher level to a lower level.

public boolean
isUp()

Implements org.glassfish.hk2.runlevel.RunLevelFuture.isUp.

Returns true if this job represents the system going from a lower level to a higher level.

private static final boolean
pack-priv static final boolean
private void
setInCallback(boolean inCallback)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait