javax.slee.management
Interface ServiceManagementMBean


public interface ServiceManagementMBean

The ServiceManagementMBean interface defines Service-related management operations. Using the ServiceManagementMBean a management client may get or change the operational states of Services, and get the set of services that are in a particular state.

The Object Name of a ServiceManagementMBean object can be obtained by a management client via the SleeManagementMBean.getServiceManagementMBean() method.


Method Summary
 void activate(ServiceID id)
          Activate a Service.
 void activate(ServiceID[] ids)
          Activate a set of Services.
 void deactivate(ServiceID id)
          Deactivate a Service.
 void deactivate(ServiceID[] ids)
          Deactivate a set of Services.
 void deactivateAndActivate(ServiceID[] deactivateIDs, ServiceID[] activateIDs)
          Deactivate one set of Services and activate another set of Services.
 void deactivateAndActivate(ServiceID deactivateID, ServiceID activateID)
          Deactivate one Service and activate another Service.
 ServiceID[] getServices(ServiceState state)
          Get the set of services that are in a particular state.
 javax.management.ObjectName getServiceUsageMBean(ServiceID id)
          Get the JMX Object Name of a ServiceUsageMBean object for a Service.
 ServiceState getState(ServiceID id)
          Get the current state of a Service.
 

Method Detail

getState

public ServiceState getState(ServiceID id)
                      throws java.lang.NullPointerException,
                             UnrecognizedServiceException,
                             ManagementException
Get the current state of a Service.
Parameters:
id - the component identifier of the Service.
Returns:
the current state of the Service.
Throws:
java.lang.NullPointerException - if id is null.
UnrecognizedServiceException - if id is not a recognizable ServiceID for the SLEE or it does not correspond with a Service installed in the SLEE.
ManagementException - if the state of the Service could not be obtained due to a system-level failure.

getServices

public ServiceID[] getServices(ServiceState state)
                        throws java.lang.NullPointerException,
                               ManagementException
Get the set of services that are in a particular state.
Parameters:
state - the required state.
Returns:
an array of ServiceID objects identifying the services that are in the specified state.
Throws:
java.lang.NullPointerException - if state is null.
ManagementException - if the set of services could not be obtained due to a system-level failure.

activate

public void activate(ServiceID id)
              throws java.lang.NullPointerException,
                     UnrecognizedServiceException,
                     InvalidStateException,
                     ManagementException
Activate a Service. The Service must currently be in the ServiceState.INACTIVE state, and transitions to ServiceState.ACTIVE state during this method invocation.
Parameters:
id - the component identifier of the Service.
Throws:
java.lang.NullPointerException - if id is null.
UnrecognizedServiceException - if id is not a recognizable ServiceID for the SLEE or it does not correspond with a Service installed in the SLEE.
InvalidStateException - if the current state of the Service is not ServiceState.INACTIVE.
ManagementException - if the state of the Service could not be changed due to a system-level failure.

activate

public void activate(ServiceID[] ids)
              throws java.lang.NullPointerException,
                     InvalidArgumentException,
                     UnrecognizedServiceException,
                     InvalidStateException,
                     ManagementException
Activate a set of Services. All Services in the set must currently be in the ServiceState.INACTIVE state, and transition to ServiceState.ACTIVE state during this method invocation.
Parameters:
ids - a set of component identifiers of the Services to be activated.
Throws:
java.lang.NullPointerException - if ids is null.
InvalidArgumentException - if ids is zero-length, or contains null or duplicate elements.
UnrecognizedServiceException - if any member of ids is not a recognizable ServiceID for the SLEE or does not correspond with a Service installed in the SLEE.
InvalidStateException - if the current state of any of the Services identified by ids is not ServiceState.INACTIVE.
ManagementException - if the state of any Service could not be changed due to a system-level failure. In the case of such an error the state of all Services identified in ids remains unchanged.

deactivate

public void deactivate(ServiceID id)
                throws java.lang.NullPointerException,
                       UnrecognizedServiceException,
                       InvalidStateException,
                       ManagementException
Deactivate a Service. The Service must currently be in the ServiceState.ACTIVE state, and transitions to ServiceState.STOPPING state during this method invocation.
Parameters:
id - the component identifier of the Service.
Throws:
java.lang.NullPointerException - if id is null.
UnrecognizedServiceException - if id is not a recognizable ServiceID for the SLEE or it does not correspond with a Service installed in the SLEE.
InvalidStateException - if the current state of the Service is not ServiceState.ACTIVE.
ManagementException - if the state of the Service could not be changed due to a system-level failure.

deactivate

public void deactivate(ServiceID[] ids)
                throws java.lang.NullPointerException,
                       InvalidArgumentException,
                       UnrecognizedServiceException,
                       InvalidStateException,
                       ManagementException
Deactivate a set of Services. All Services in the set must currently be in the ServiceState.ACTIVE state, and transition to ServiceState.STOPPING state during this method invocation.
Parameters:
ids - a set of component identifiers of Services to be deactivated.
Throws:
java.lang.NullPointerException - if ids is null.
InvalidArgumentException - if ids is zero-length, or contains null or duplicate elements.
UnrecognizedServiceException - if any member of ids is not a recognizable ServiceID for the SLEE or does not correspond with a Service installed in the SLEE.
InvalidStateException - if the current state of any of the Services identified by ids is not ServiceState.ACTIVE.
ManagementException - if the state of any Service could not be changed due to a system-level failure. In the case of such an error the state of all Services identified in ids remains unchanged.

deactivateAndActivate

public void deactivateAndActivate(ServiceID deactivateID,
                                  ServiceID activateID)
                           throws java.lang.NullPointerException,
                                  InvalidArgumentException,
                                  UnrecognizedServiceException,
                                  InvalidStateException,
                                  ManagementException
Deactivate one Service and activate another Service. The first Service must currently be in the ServiceState.ACTIVE state, and transitions to ServiceState.STOPPING state during this method invocation. The second Service must be in the ServiceState.INACTIVE state and transitions to the ServiceState.ACTIVE state during this method invocation.
Parameters:
deactivateID - the component identifier of the Service to be deactivated.
activateID - the component identifier of the Service to be activated.
Throws:
java.lang.NullPointerException - if either argument is null.
InvalidArgumentException - if deactivateID and activateID identify the same Service.
UnrecognizedServiceException - if either argument is not a recognizable ServiceID for the SLEE or does not correspond with a Service installed in the SLEE.
InvalidStateException - if the current state of the Service identified by deactivateID is not ServiceState.ACTIVE or the the current state of the Service identified by activateID is not ServiceState.INACTIVE.
ManagementException - if the state of either Service could not be changed due to a system-level failure. In the case of such an error the state of both Services remains unchanged.

deactivateAndActivate

public void deactivateAndActivate(ServiceID[] deactivateIDs,
                                  ServiceID[] activateIDs)
                           throws java.lang.NullPointerException,
                                  InvalidArgumentException,
                                  UnrecognizedServiceException,
                                  InvalidStateException,
                                  ManagementException
Deactivate one set of Services and activate another set of Services. All Services in the first set must currently be in the ServiceState.ACTIVE state, and transition to ServiceState.STOPPING state during this method invocation. All Services in the second set must be in the ServiceState.INACTIVE state and transition to the ServiceState.ACTIVE state during this method invocation.
Parameters:
deactivateIDs - a set of component identifiers of Services to be deactivated.
activateIDs - a set of component identifiers of Services to be activated.
Throws:
java.lang.NullPointerException - if either argument is null.
InvalidArgumentException - if either argument is zero-length, contains null or duplicate elements, or a Service identified by a a component identifier in deactivateIDs is the same as a Service identified by a component identifier in activateIDs.
UnrecognizedServiceException - if any member of deactivateIDs or activateIDs is not a recognizable ServiceID for the SLEE or does not correspond with a Service installed in the SLEE.
InvalidStateException - if the current state of any of the Services identified by deactivateIDs is not ServiceState.ACTIVE or the the current state of any of the Services identified by activateIDs set is not ServiceState.INACTIVE.
ManagementException - if the state of any of the Services could not be changed due to a system-level failure. In the case of such an error the state of all Services identified in deactivateIDs and activateIDs remains unchanged.

getServiceUsageMBean

public javax.management.ObjectName getServiceUsageMBean(ServiceID id)
                                                 throws java.lang.NullPointerException,
                                                        UnrecognizedServiceException,
                                                        ManagementException
Get the JMX Object Name of a ServiceUsageMBean object for a Service.
Parameters:
id - the component identifier of the Service.
Returns:
the Object Name of a ServiceUsageMBean object for the specified Service.
Throws:
java.lang.NullPointerException - if id is null.
UnrecognizedServiceException - if id is not a recognizable ServiceID for the SLEE or it does not correspond with a Service installed in the SLEE.
ManagementException - if the object name could not be obtained due to a system-level failure.