Package org.glassfish.hk2.api
Interface ImmediateController
- All Known Implementing Classes:
ImmediateHelper
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
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionReturns the executor that is currently in use by the Immediate subsystemReturns the state the system is currently running underlong
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
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 Details
-
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
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
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
Sets the state the system is currently running under- Parameters:
state
- The new state of the ImmediateService
-