org.glassfish.hk2.runlevel
Interface RunLevelController

All Known Implementing Classes:
RunLevelControllerImpl

@Contract
public interface RunLevelController

Implementations of this contract are responsible for orchestration lifecycle events (i.e., start levels) in Hk2.

Each run level service is responsible for a particular class of RunLevel that is identified by a RunLevelControllerIndicator value.

Implementations of this service are responsible for orchestrating lifecycle events for services annotated with RunLevel.

Author:
jtrent, tbeerbower

Field Summary
static String RUNLEVEL_CONTROLLER_DEFAULT_NAME
          The default run level service name.
 
Method Summary
 Integer getCurrentRunLevel()
          The current run level state.
 String getName()
          Get the name of this RunLevelController.
 Integer getPlannedRunLevel()
          The planned run level state.
 void interrupt()
          Causes this RunLevelController to attempt to stop any in-flight proceedTo() operation.
 void proceedTo(int runLevel)
          Causes this RunLevelController to move to the specified run level for all RunLevel instances (identified by RunLevelControllerIndicator), orchestrating the appropriate lifecycle events.
 void recordActivation(ActiveDescriptor<?> descriptor)
          Record the activation the run level service associated with the given descriptor.
 

Field Detail

RUNLEVEL_CONTROLLER_DEFAULT_NAME

static final String RUNLEVEL_CONTROLLER_DEFAULT_NAME
The default run level service name.

See Also:
Constant Field Values
Method Detail

proceedTo

void proceedTo(int runLevel)
Causes this RunLevelController to move to the specified run level for all RunLevel instances (identified by RunLevelControllerIndicator), orchestrating the appropriate lifecycle events.

If the run level specified is the same as the current run level then the RunLevelController may return immediately.

Note that the underlying implementation may perform this operation asynchronously. Implementors who choose the asynchronous approach are expected to treat a subsequent proceedTo(newRunLevel) call as an implicit cancellation of any currently running proceedTo() that is running on one or more managed threads.

Parameters:
runLevel - the run level to move to

interrupt

void interrupt()
Causes this RunLevelController to attempt to stop any in-flight proceedTo() operation. This call will not have any effect if there is no current proceedTo() operation in progress.


getCurrentRunLevel

Integer getCurrentRunLevel()
The current run level state. This represents the last run level successfully achieved by the underlying RunLevelController responsible for this scope.

Returns:
the current run level, or null if no run level has been been achieved

getPlannedRunLevel

Integer getPlannedRunLevel()
The planned run level state.

Returns:
the planned run level, or null if there is no planned level

getName

String getName()
Get the name of this RunLevelController.

Returns:
the name

recordActivation

void recordActivation(ActiveDescriptor<?> descriptor)
Record the activation the run level service associated with the given descriptor.

Parameters:
descriptor - the descriptor


Copyright © 2013 Oracle Corporation. All Rights Reserved.