public interface UsageMBean
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:
SbbNotification
:
ProfileTableNotification
:
ResourceAdaptorEntityNotification
:
SubsystemNotification
:
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:
public long get<usage-parameter-name>(boolean reset) throws ManagementException;
Each sample-type usage parameter causes the addition of a managed operation with the following signature:
public SampleStatistics get<usage-parameter-name>(boolean reset) throws ManagementException;
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.
Modifier and Type | Field and Description |
---|---|
static String |
BASE_OBJECT_NAME
The base JMX Object Name string of all SLEE Usage MBeans.
|
static 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 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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
ObjectName |
getUsageNotificationManagerMBean()
Get the JMX Object Name of the
UsageNotificationManagerMBean
that provides management access to the usage notification manager for this Usage
MBean. |
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.
|
static final String BASE_OBJECT_NAME
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.static final String NOTIFICATION_SOURCE_KEY
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
.BASE_OBJECT_NAME
,
Constant Field Valuesstatic final String USAGE_PARAMETER_SET_NAME_KEY
BASE_OBJECT_NAME
,
Constant Field ValuesNotificationSource getNotificationSource() throws ManagementException
UsageNotification
emitted by the
Usage MBean.ManagementException
- if the notification source could not be obtained due
to a system-level failure.String getUsageParameterSet() throws ManagementException
null
if this MBean is presenting
usage information for the default usage parameter set.ManagementException
- if the usage parameter set name could not be obtained
due to a system-level failure.ObjectName getUsageNotificationManagerMBean() throws ManagementException
UsageNotificationManagerMBean
that provides management access to the usage notification manager for this Usage
MBean.ManagementException
- if the Object Name could not be obtained due to a
system-level failure.void resetAllUsageParameters() throws ManagementException
ManagementException
- if the values of the usage parameters could not be reset
due to a system-level failure.void close() throws InvalidStateException, ManagementException
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.