|
JBoss Modular Service Kernel API 1.0.0.CR2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
S
- the service typepublic interface ServiceController<S>
A controller for a single service instance.
Nested Class Summary | |
---|---|
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
A fine-grained substate of the more general basic controller ServiceController.State s. |
static class |
ServiceController.Transition
A transition from one substate to another. |
Method Summary | |
---|---|
void |
addListener(ServiceListener.Inheritance inheritance,
ServiceListener<Object> serviceListener)
Add a service listener. |
void |
addListener(ServiceListener<? super S> serviceListener)
Add a service listener. |
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()
Get the complete list of immediate dependencies that are unavailable. |
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()
Get the service. |
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()
Get the current service controller substate. |
S |
getValue()
Get the service value. |
void |
removeListener(ServiceListener<? super S> serviceListener)
Remove a service listener. |
void |
retry()
Retry a failed service. |
void |
setMode(ServiceController.Mode mode)
Change the service controller's current mode. |
Method Detail |
---|
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 mode
true
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 mode
IllegalStateException
- 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()
ServiceController.Substate getSubstate()
S getValue() throws IllegalStateException
getValue
in interface Value<S>
IllegalStateException
- if the service is not available (i.e. it is not up)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(ServiceListener<? super S> serviceListener)
serviceListener
- the service listenervoid addListener(ServiceListener.Inheritance inheritance, ServiceListener<Object> serviceListener)
inheritance
- the inheritance type for this listenerserviceListener
- the service listenervoid removeListener(ServiceListener<? super S> serviceListener)
serviceListener
- the service listener to removeStartException getStartException()
null
if the last start succeeded or the service has not yet startedvoid retry()
ServiceController.State.START_FAILED
.
Set<ServiceName> getImmediateUnavailableDependencies()
|
JBoss Modular Service Kernel API 1.0.0.CR2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |