Top Description Inners Methods
org.glassfish.hk2.api

public Interface ImmediateController

Known Direct Implementers
org.glassfish.hk2.internal.ImmediateHelper
Annotations
@Contract
Imports
java.util.concurrent.Executor, org.jvnet.hk2.annotations.Contract

This service is advertised when the Immediate service is put into the registry. The immediate service by default starts in the SUSPENDED state so that the Executor and other parameters can be set prior to the first Immediate service being started
Author
jwells

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum

Method Summary

Modifier and TypeMethod and Description
public Executor

Returns:

The current executor in use by the controller. Will not return null since a default executor is used and returned by this call even if setExecutor is called with null
getExecutor
()

Returns the executor that is currently in use by the Immediate subsystem

public ImmediateController.ImmediateServiceState

Returns:

The current state of the ImmediateService
getImmediateState
()

Returns the state the system is currently running under

public long

Returns:

The time in milliseconds a thread will wait for new Immediate service before dying
getThreadInactivityTimeout
()

Returns the time in milliseconds a thread will wait for new Immediate services before dying

public void
setExecutor(Executor
The executor to be used when scheduling work. If null a default executor implementation will be used
executor
)

Sets the executor to be used by the Immediate subsystem.

public void
setImmediateState(ImmediateController.ImmediateServiceState
The new state of the ImmediateService
state
)

Sets the state the system is currently running under

public void
setThreadInactivityTimeout(long
The time in milliseconds a thread will wait for new Immediate service before dying
timeInMillis
)

Sets the time in milliseconds a thread will wait for new Immediate services before dying

Method Detail

getExecutorback to summary
public Executor getExecutor()

Returns the executor that is currently in use by the Immediate subsystem

Returns:Executor

The current executor in use by the controller. Will not return null since a default executor is used and returned by this call even if setExecutor is called with null

getImmediateStateback to summary
public ImmediateController.ImmediateServiceState getImmediateState()

Returns the state the system is currently running under

Returns:ImmediateController.ImmediateServiceState

The current state of the ImmediateService

getThreadInactivityTimeoutback to summary
public long getThreadInactivityTimeout()

Returns the time in milliseconds a thread will wait for new Immediate services before dying

Returns:long

The time in milliseconds a thread will wait for new Immediate service before dying

setExecutorback to summary
public void setExecutor(Executor executor) throws IllegalStateException

Sets the executor to be used by the Immediate subsystem. If set to null a default executor will be used. This may only be called when the Immediate service is suspended

Parameters
executor:Executor

The executor to be used when scheduling work. If null a default executor implementation will be used

Exceptions
IllegalStateException:
if this is called when the Immediate service is not in suspended state
setImmediateStateback to summary
public void setImmediateState(ImmediateController.ImmediateServiceState state)

Sets the state the system is currently running under

Parameters
state:ImmediateController.ImmediateServiceState

The new state of the ImmediateService

setThreadInactivityTimeoutback to summary
public void setThreadInactivityTimeout(long timeInMillis) throws IllegalArgumentException

Sets the time in milliseconds a thread will wait for new Immediate services before dying

Parameters
timeInMillis:long

The time in milliseconds a thread will wait for new Immediate service before dying

Exceptions
IllegalArgumentException:
if timeInMillis is less than zero
org.glassfish.hk2.api back to summary

public final Enum ImmediateController.ImmediateServiceState

extends Enum<ImmediateController.ImmediateServiceState>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final ImmediateController.ImmediateServiceState
RUNNING

The system will create new Immediate services as soon as they are found

public static final ImmediateController.ImmediateServiceState
SUSPENDED

The system will not create new Immediate services when in SUSPENDED state.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static ImmediateController.ImmediateServiceState
public static ImmediateController.ImmediateServiceState[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

RUNNINGback to summary
public static final ImmediateController.ImmediateServiceState RUNNING

The system will create new Immediate services as soon as they are found

SUSPENDEDback to summary
public static final ImmediateController.ImmediateServiceState SUSPENDED

The system will not create new Immediate services when in SUSPENDED state. Suspended state does not imply that Immediate services will be shutdown, but rather that any new Immediate services that come along will not be started

Constructor Detail

ImmediateServiceStateback to summary
private ImmediateServiceState()

Method Detail

valueOfback to summary
public static ImmediateController.ImmediateServiceState valueOf(String name)
valuesback to summary
public static ImmediateController.ImmediateServiceState[] values()