@Contract public interface RunLevelController
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
.
Modifier and Type | Interface and Description |
---|---|
static class |
RunLevelController.ThreadingPolicy
These are the policies for how the RunLevelController
will use threads
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
If there is a current procedure in process this method will get it
and cancel it
|
RunLevelFuture |
getCurrentProceeding()
This method will return the current proceedTo that the RunLevelController
is working on, or it will return null if the controller is not currently
moving up or down
|
int |
getCurrentRunLevel()
The current run level state.
|
int |
getMaximumUseableThreads()
Returns the current number of maximum useable threads
|
RunLevelController.ThreadingPolicy |
getThreadingPolicy()
Returns the threading policy currently being used by
this controller
|
void |
proceedTo(int runLevel)
This method will move to the given run level synchronously as per
proceedToAsync(int) . |
RunLevelFuture |
proceedToAsync(int runLevel)
Causes this RunLevelController to move to the specified run level for
all
RunLevel instances, orchestrating the appropriate
lifecycle events. |
void |
setMaximumUseableThreads(int maximumThreads)
This sets the maximum number of threads that the system
can create for creation and/or destruction of threads.
|
void |
setThreadingPolicy(RunLevelController.ThreadingPolicy policy)
Sets the threading policy that will be used by
this controller.
|
RunLevelFuture proceedToAsync(int runLevel) throws CurrentlyRunningException, IllegalStateException
RunLevel
instances, orchestrating the appropriate
lifecycle events.
If the run level specified is the same as the current run level then the RunLevelController may return immediately
runLevel
- the run level to move toCurrentlyRunningException
- if there is currently a job running
this exception will be thrown with the currently running jobIllegalStateException
- if this method is called when the
USE_NO_THREADS policy is in effectvoid proceedTo(int runLevel) throws CurrentlyRunningException
proceedToAsync(int)
.runLevel
- The level that should be proceeded toCurrentlyRunningException
RunLevelFuture getCurrentProceeding()
void cancel()
int getCurrentRunLevel()
void setMaximumUseableThreads(int maximumThreads)
maximumThreads
- The maximum number of threads that
can be used by the system for creation or destruction of
servicesint getMaximumUseableThreads()
void setThreadingPolicy(RunLevelController.ThreadingPolicy policy)
policy
- The policy that should be used by this controllerRunLevelController.ThreadingPolicy getThreadingPolicy()
Copyright © 2013 Oracle Corporation. All rights reserved.