Package org.glassfish.hk2.api
Interface ImmediateController
-
- All Known Implementing Classes:
ImmediateHelper
@Contract public interface ImmediateController
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 Class Summary
Nested Classes Modifier and Type Interface Description static class
ImmediateController.ImmediateServiceState
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Executor
getExecutor()
Returns the executor that is currently in use by the Immediate subsystemImmediateController.ImmediateServiceState
getImmediateState()
Returns the state the system is currently running underlong
getThreadInactivityTimeout()
Returns the time in milliseconds a thread will wait for new Immediate services before dyingvoid
setExecutor(Executor executor)
Sets the executor to be used by the Immediate subsystem.void
setImmediateState(ImmediateController.ImmediateServiceState state)
Sets the state the system is currently running undervoid
setThreadInactivityTimeout(long timeInMillis)
Sets the time in milliseconds a thread will wait for new Immediate services before dying
-
-
-
Method Detail
-
getExecutor
Executor getExecutor()
Returns the executor that is currently in use by the Immediate subsystem- 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
-
setExecutor
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
- The executor to be used when scheduling work. If null a default executor implementation will be used- Throws:
IllegalStateException
- if this is called when the Immediate service is not in suspended state
-
getThreadInactivityTimeout
long getThreadInactivityTimeout()
Returns the time in milliseconds a thread will wait for new Immediate services before dying- Returns:
- The time in milliseconds a thread will wait for new Immediate service before dying
-
setThreadInactivityTimeout
void setThreadInactivityTimeout(long timeInMillis) throws IllegalArgumentException
Sets the time in milliseconds a thread will wait for new Immediate services before dying- Parameters:
timeInMillis
- The time in milliseconds a thread will wait for new Immediate service before dying- Throws:
IllegalArgumentException
- if timeInMillis is less than zero
-
getImmediateState
ImmediateController.ImmediateServiceState getImmediateState()
Returns the state the system is currently running under- Returns:
- The current state of the ImmediateService
-
setImmediateState
void setImmediateState(ImmediateController.ImmediateServiceState state)
Sets the state the system is currently running under- Parameters:
state
- The new state of the ImmediateService
-
-