public interface Service extends ServiceMBean
Objects mapped to Strings.| Modifier and Type | Method and Description |
|---|---|
void |
addServiceListener(ServiceListener serviceListener)
Adds the given service listener to the list of service listeners that
will be notified on service events.
|
void |
destroy()
Destroys the service and frees all used resources.
|
String |
getAction()
Returns the current action of the service.
|
String |
getName()
Returns the name of this service.
|
Object |
getServiceAttribute(String attributeName)
Returns the value of the service attribute with the given name.
|
State |
getState()
Returns the current state of this service.
|
String |
getStateReason()
Deprecated.
Use
getAction() instead |
boolean |
hasServiceAttribute(String attributeName)
Returns whether this service contains a service attribute with the given
name.
|
void |
init()
Initializes the service.
|
void |
removeServiceListener(ServiceListener serviceListener)
Removes the given service listeners from the list of service listeners.
|
void |
setServiceAttribute(String attributeName,
Object attributeValue)
Sets the service attribute with the given name to the given value.
|
void |
start()
Starts the service.
|
void |
stop()
Stops the service.
|
String getName()
State getState()
getState in interface ServiceMBean@Deprecated String getStateReason()
getAction() insteadnull.String getAction()
getAction in interface ServiceMBeanServiceMBean.getAction()void addServiceListener(ServiceListener serviceListener)
serviceListener - The service listener to addvoid removeServiceListener(ServiceListener serviceListener)
serviceListener - The service listener to removevoid init()
void start()
start in interface ServiceMBeanvoid stop()
stop in interface ServiceMBeanvoid destroy()
void setServiceAttribute(String attributeName, Object attributeValue)
attributeName - The name of the attributeattributeValue - The value of the attributeObject getServiceAttribute(String attributeName)
attributeName - The name of the attributeboolean hasServiceAttribute(String attributeName)
attributeName - The name of the attributetrue if this service has a service attribute with
the given name, false otherwiseCopyright © 2026. All rights reserved.