|
JBoss Modular Service Kernel API 1.0.0.Beta6 | |||||||||
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. |
Method Summary | |
---|---|
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. |
Location |
getLocation()
Get the location of this service. |
ServiceController.Mode |
getMode()
Get the service controller's current mode. |
ServiceName |
getName()
Get the name of this service, if any. |
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. |
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 |
---|
ServiceContainer 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()
S getValue() throws IllegalStateException
getValue
in interface Value<S>
IllegalStateException
- if the service is not available (i.e. it is not up)ServiceName getName()
null
if none was specified.ServiceName[] getAliases()
Location getLocation()
void addListener(ServiceListener<? super S> serviceListener)
serviceListener
- 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
.
|
JBoss Modular Service Kernel API 1.0.0.Beta6 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |