javax.slee.usage
Interface UsageMBean


public interface UsageMBean

The UsageMBean interface defines the basic common functionality required for the management of a single usage parameter set.

The base JMX Object Name of a UsageMBean object is specified by the BASE_OBJECT_NAME constant. The USAGE_PARAMETER_SET_NAME_KEY constant specifies the name of the Object Name property that is present in the Object Name of Usage MBeans for named usage parameter sets. The NOTIFICATION_SOURCE_KEY constant specifies the Object Name property that identifies the type of the notification source for the Usage MBean. In addition to this property, each notification source includes additional properties in the Usage MBean Object Name with the property keys indicated below:

A management client may obtain the complete Object Name of a Usage MBean for an SBB via the ServiceUsageMBean interface. The complete Object Name of a Usage MBean for a profile table may be obtained using the ProfileProvisioningMBean interface. The complete Object Name of a Usage MBean for a resource adaptor entity may be obtained using the ResourceManagementMBean interface. The complete Object Name of a Usage MBean for a SLEE internal component or subsystem may be obtained using the SleeManagementMBean interface.

Interface extension
During deployment of a SLEE component that defines a usage parameters interface, the UsageMBean interface is extended to provide access to the usage parameters defined in the usage parameters interface. Each counter-type usage parameter causes the addition of a managed operation with the following signature:

Each sample-type usage parameter causes the addition of a managed operation with the following signature:

In each operation, usage-parameter-name is the name of the usage parameter, with the first letter capitalized. The reset parameter taken by each operation is used to optionally reset the usage parameter value after the return result has been obtained.

Notifications
Since UsageMBean objects can emit usage notifications, it is required that a UsageMBean object implement the javax.management.NotificationBroadcaster interface. The NotificationSource object obtained from a Usage MBean's getNotificationSource() method is included in each usage notification emitted by the Usage MBean.

Since:
SLEE 1.1

Field Summary
static java.lang.String BASE_OBJECT_NAME
          The base JMX Object Name string of all SLEE Usage MBeans.
static java.lang.String NOTIFICATION_SOURCE_KEY
          The JMX Object Name property key that identifies the type of the notification source that the Usage MBean is providing usage information for.
static java.lang.String USAGE_PARAMETER_SET_NAME_KEY
          The JMX Object Name property key that identifies the name of the usage parameter set that the Usage MBean is providing usage information for.
 
Method Summary
 void close()
          Notify the SLEE that the Usage MBean is no longer required by the management client.
 NotificationSource getNotificationSource()
          Get the notification source that this Usage MBean is presenting usage information for.
 javax.management.ObjectName getUsageNotificationManagerMBean()
          Get the JMX Object Name of the UsageNotificationManagerMBean that provides management access to the usage notification manager for this Usage MBean.
 java.lang.String getUsageParameterSet()
          Get the name of the usage parameter set that this Usage MBean is presenting usage information for.
 void resetAllUsageParameters()
          Reset all usage parameters in the usage parameter set managed by this Usage MBean.
 

Field Detail

BASE_OBJECT_NAME

static final java.lang.String BASE_OBJECT_NAME
The base JMX Object Name string of all SLEE Usage MBeans. This string is equal to "javax.slee.usage:type=Usage", and the string BASE_OBJECT_NAME + ",*" defines a JMX Object Name property pattern which matches with all Usage MBeans that are registered with the MBean Server. A Usage MBean is registered with the MBean Server using this base name in conjunction with the property specified by NOTIFICATION_SOURCE_KEY and additional properties depending on the presence of a usage parameter set name and the type of the notification source.

Since:
SLEE 1.1
See Also:
Constant Field Values

NOTIFICATION_SOURCE_KEY

static final java.lang.String NOTIFICATION_SOURCE_KEY
The JMX Object Name property key that identifies the type of the notification source that the Usage MBean is providing usage information for. This key is equal to the string "notificationSource". The value of this key is equal to the USAGE_NOTIFICATION_TYPE constant defined by the notification source. For example, if this Usage MBean was providing usage information for an SBB, the Object Name of the Usage MBean would contain a property with a key specified by this constant and a value equal to SbbNotification.USAGE_NOTIFICATION_TYPE.

Since:
SLEE 1.1
See Also:
BASE_OBJECT_NAME, Constant Field Values

USAGE_PARAMETER_SET_NAME_KEY

static final java.lang.String USAGE_PARAMETER_SET_NAME_KEY
The JMX Object Name property key that identifies the name of the usage parameter set that the Usage MBean is providing usage information for. This key is equal to the string "parameterSetName". This attribute is only present in Usage MBeans for named usage parameter sets. It is not present in Usage MBeans for unnamed usage parameter set.

Since:
SLEE 1.1
See Also:
BASE_OBJECT_NAME, Constant Field Values
Method Detail

getNotificationSource

NotificationSource getNotificationSource()
                                         throws ManagementException
Get the notification source that this Usage MBean is presenting usage information for. This object is included in every UsageNotification emitted by the Usage MBean.

Returns:
the notification source.
Throws:
ManagementException - if the notification source could not be obtained due to a system-level failure.

getUsageParameterSet

java.lang.String getUsageParameterSet()
                                      throws ManagementException
Get the name of the usage parameter set that this Usage MBean is presenting usage information for.

Returns:
the name of the usage parameter set that this Usage MBean is presenting usage information for, or null if this MBean is presenting usage information for the default usage parameter set.
Throws:
ManagementException - if the usage parameter set name could not be obtained due to a system-level failure.

getUsageNotificationManagerMBean

javax.management.ObjectName getUsageNotificationManagerMBean()
                                                             throws ManagementException
Get the JMX Object Name of the UsageNotificationManagerMBean that provides management access to the usage notification manager for this Usage MBean.

Throws:
ManagementException - if the Object Name could not be obtained due to a system-level failure.

resetAllUsageParameters

void resetAllUsageParameters()
                             throws ManagementException
Reset all usage parameters in the usage parameter set managed by this Usage MBean. Counter-type usage parameters are reset to 0 and sample-type usage parameters have all samples cleared.

Throws:
ManagementException - if the values of the usage parameters could not be reset due to a system-level failure.

close

void close()
           throws InvalidStateException,
                  ManagementException
Notify the SLEE that the Usage MBean is no longer required by the management client. As the SLEE may subsequently deregister the Usage MBean from the MBean server, a client that invokes this method should assume that the Object Name they had for the MBean is no longer valid once this method returns.

Throws:
InvalidStateException - if notification listeners are still attached to the Usage MBean, indicating that the MBean cannot be deregistered at this time.
ManagementException - if the Usage MBean could not be closed by the SLEE due to a system-level failure.


Copyright © 2009. All Rights Reserved.