S - the service typepublic interface ServiceController<S> extends Value<S>
| Modifier and Type | Interface and Description |
|---|---|
static class |
ServiceController.Mode
The controller mode for a service.
|
static class |
ServiceController.State
A possible state for a service controller.
|
static class |
ServiceController.Substate
Deprecated.
this class will be removed in a future release
|
static class |
ServiceController.Transition
Deprecated.
this class will be removed in a future release
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(LifecycleListener listener)
Add a service lifecycle listener.
|
void |
addListener(ServiceListener<? super S> serviceListener)
Deprecated.
use
addListener(LifecycleListener) instead |
S |
awaitValue()
Deprecated.
this method will be removed in a future release
|
S |
awaitValue(long time,
TimeUnit unit)
Deprecated.
this method will be removed in a future release
|
boolean |
compareAndSetMode(ServiceController.Mode expected,
ServiceController.Mode newMode)
Compare the current mode against
expected; if it matches, change it to newMode. |
ServiceName[] |
getAliases()
Get other names this service is known as.
|
Set<ServiceName> |
getImmediateUnavailableDependencies()
Deprecated.
use
getUnavailableDependencies() instead |
ServiceController.Mode |
getMode()
Get the service controller's current mode.
|
ServiceName |
getName()
Get the name of this service, if any.
|
ServiceController<?> |
getParent()
Get this service's parent service, or
null if there is none. |
Service<S> |
getService()
Deprecated.
this method will be removed in a future release
|
ServiceContainer |
getServiceContainer()
Get the service container associated with this controller.
|
StartException |
getStartException()
Get the reason why the last start failed.
|
ServiceController.State |
getState()
Get the current service controller state.
|
ServiceController.Substate |
getSubstate()
Deprecated.
this method will be removed in a future release
|
Collection<ServiceName> |
getUnavailableDependencies()
Get the complete list of dependencies that are unavailable.
|
S |
getValue()
Deprecated.
this method will be removed in a future release
|
void |
removeListener(LifecycleListener listener)
Remove a lifecycle listener.
|
void |
removeListener(ServiceListener<? super S> serviceListener)
Deprecated.
use
removeListener(LifecycleListener) instead |
void |
retry()
Retry a failed service.
|
void |
setMode(ServiceController.Mode mode)
Change the service controller's current mode.
|
ServiceController<?> getParent()
null if there is none.null if this service has no parentServiceContainer getServiceContainer()
ServiceController.Mode getMode()
boolean compareAndSetMode(ServiceController.Mode expected, ServiceController.Mode newMode)
expected; if it matches, change it to newMode. The
return value is true when the mode was matched and changed.expected - the expected modenewMode - the new modetrue if the mode was changedvoid setMode(ServiceController.Mode mode)
ServiceController.Mode.REMOVE. Calling this method with the controller's
current mode has no effect and is always allowed.mode - the new controller modeIllegalStateException - if the mode given is null, or the caller attempted to change the
service's mode from ServiceController.Mode.REMOVE to a different modeServiceController.State getState()
@Deprecated ServiceController.Substate getSubstate()
@Deprecated S getValue() throws IllegalStateException
getValue in interface Value<S>IllegalStateException - if the service is not available (i.e. it is not up)@Deprecated S awaitValue() throws IllegalStateException, InterruptedException
IllegalStateException - if the service is not available (i.e. it was removed or failed)InterruptedException - if the wait operation was interrupted@Deprecated S awaitValue(long time, TimeUnit unit) throws IllegalStateException, InterruptedException, TimeoutException
time - the amount of time to waitunit - the unit of time to waitIllegalStateException - if the service is not available (i.e. it was removed or failed)InterruptedException - if the wait operation was interruptedTimeoutException@Deprecated Service<S> getService() throws IllegalStateException
IllegalStateException - if the service is not available (i.e. it is not up)ServiceName getName()
null if none was specified.ServiceName[] getAliases()
void addListener(LifecycleListener listener)
listener - the lifecycle listener@Deprecated void addListener(ServiceListener<? super S> serviceListener)
addListener(LifecycleListener) insteadserviceListener - the service listenervoid removeListener(LifecycleListener listener)
listener - the lifecycle listener to remove@Deprecated void removeListener(ServiceListener<? super S> serviceListener)
removeListener(LifecycleListener) insteadserviceListener - the service listener to removeStartException getStartException()
null if the last start succeeded or the service has not yet startedvoid retry()
ServiceController.State.START_FAILED.@Deprecated Set<ServiceName> getImmediateUnavailableDependencies()
getUnavailableDependencies() insteadCollection<ServiceName> getUnavailableDependencies()
Copyright © 2018 JBoss by Red Hat. All rights reserved.