@Service @ContractsProvided(value=RunLevelController.class) public class RunLevelControllerImpl extends Object implements RunLevelController
RunLevelController.ThreadingPolicy
Constructor and Description |
---|
RunLevelControllerImpl() |
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
RunLevelController.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.
|
public void proceedTo(int runLevel)
RunLevelController
RunLevelController.proceedToAsync(int)
.proceedTo
in interface RunLevelController
runLevel
- The level that should be proceeded topublic RunLevelFuture proceedToAsync(int runLevel) throws CurrentlyRunningException, IllegalStateException
RunLevelController
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
proceedToAsync
in interface RunLevelController
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 effectpublic RunLevelFuture getCurrentProceeding()
RunLevelController
getCurrentProceeding
in interface RunLevelController
public void cancel()
RunLevelController
cancel
in interface RunLevelController
public int getCurrentRunLevel()
RunLevelController
getCurrentRunLevel
in interface RunLevelController
public void setMaximumUseableThreads(int maximumThreads)
RunLevelController
setMaximumUseableThreads
in interface RunLevelController
maximumThreads
- The maximum number of threads that
can be used by the system for creation or destruction of
servicespublic int getMaximumUseableThreads()
RunLevelController
getMaximumUseableThreads
in interface RunLevelController
public void setThreadingPolicy(RunLevelController.ThreadingPolicy policy)
RunLevelController
setThreadingPolicy
in interface RunLevelController
policy
- The policy that should be used by this controllerpublic RunLevelController.ThreadingPolicy getThreadingPolicy()
RunLevelController
getThreadingPolicy
in interface RunLevelController
Copyright © 2013 Oracle Corporation. All Rights Reserved.