server.getAttribute(objectName, name + "NotificationsEnabled");
public static class RemoteUsage.UsageNotificationManager extends Object
Helps enabling/disabling notifications for usage parameters.
This class can be instantiated directly by a client if an ObjectName reference has already been obtained, but is normally created and returned by calling on of the following methods:
Constructor and Description |
---|
UsageNotificationManager(MBeanServerConnection server,
ObjectName objectName)
Create a usage notification manager.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the Usage Notification Manager MBean.
|
boolean |
getNotificationsEnabled(String name)
Determine whether notifications are enabled for a usage parameter.
|
int |
getParameterCount()
Get the number of usage parameter names available to have notifications enabled.
|
String |
getUsageParametersInterfaceType()
Get the usage parameters interface type.
|
Iterator |
nameIterator()
Get an iterator of the usage parameter names available to have notifications enabled.
|
void |
setNotificationsEnabled(String name,
boolean enabled)
Enable notifications for a usage parameter.
|
public UsageNotificationManager(MBeanServerConnection server, ObjectName objectName) throws ManagementException
Create a usage notification manager.
server
- a server connectionobjectName
- the objectName of the Usage Notification MBeanManagementException
public String getUsageParametersInterfaceType()
Get the usage parameters interface type.
This method only returns a non-null value if the usage parameters interface was declared using the Rhino extension mechanism.
null
if the usage parameters interface was declared using the standard SLEE mechanism.public int getParameterCount() throws ManagementException
Get the number of usage parameter names available to have notifications enabled.
ManagementException
public Iterator nameIterator() throws ManagementException
Get an iterator of the usage parameter names available to have notifications enabled.
ManagementException
public boolean getNotificationsEnabled(String name) throws ManagementException
Determine whether notifications are enabled for a usage parameter.
After checking the the usage parameter name is valid, this method invokes getAttribute using the MBean server and object name stored in this instance of UsageNotificationManager
:
server.getAttribute(objectName, name + "NotificationsEnabled");
name
- the name of the usage parameter to testManagementException
- if any problem occurs invoking getAttribute on the MBean serverpublic void setNotificationsEnabled(String name, boolean enabled) throws ManagementException
Enable notifications for a usage parameter.
This method simply invokes setAttribute using the MBean server and object name stored in this instance of UsageNotificationManager
:
server.setAttribute(objectName, new Attribute(name + "NotificationsEnabled", enabled));
name
- the name of the usage parameter to enable/disable notifications forenabled
- true - enabled, false - disabledManagementException
- if any problem occurs invoking setAttribute on the MBean serverpublic void close() throws ManagementException
Close the Usage Notification Manager MBean.
ManagementException
- if any problem occurs closing the MBean