javax.management

Class MBeanServerDelegate

public class MBeanServerDelegate extends Object implements MBeanServerDelegateMBean, NotificationEmitter

Provides an implementation of a delegate bean, which is associated with a management server. The delegate bean is responsible for providing metadata about the server and handling the registration and deregistration notifications.

Since: 1.5

Constructor Summary
MBeanServerDelegate()
Default constructor which generates the id.
Method Summary
voidaddNotificationListener(NotificationListener listener, NotificationFilter filter, Object passback)
Registers the specified listener as a new recipient of notifications from the delegate.
StringgetImplementationName()
Returns the name of this Java Management eXtensions (JMX) implementation.
StringgetImplementationVendor()
Returns the vendor of this Java Management eXtensions (JMX) implementation.
StringgetImplementationVersion()
Returns the version of this Java Management eXtensions (JMX) implementation.
StringgetMBeanServerId()
Returns the unique identifier for this management server.
MBeanNotificationInfo[]getNotificationInfo()
Returns an array describing the notifications this bean may send to its registered listeners.
StringgetSpecificationName()
Returns the name of this Java Management eXtensions (JMX) specification.
StringgetSpecificationVendor()
Returns the vendor of this Java Management eXtensions (JMX) specification.
StringgetSpecificationVersion()
Returns the version of this Java Management eXtensions (JMX) specification.
voidremoveNotificationListener(NotificationListener listener)
Removes the specified listener from the list of recipients of notifications from this bean.
voidremoveNotificationListener(NotificationListener listener, NotificationFilter filter, Object passback)
Removes the specified listener from the list of recipients of notifications from this delegate.
voidsendNotification(Notification notification)
Allows the server to use the delegate to send a notification.

Constructor Detail

MBeanServerDelegate

public MBeanServerDelegate()
Default constructor which generates the id.

Method Detail

addNotificationListener

public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object passback)
Registers the specified listener as a new recipient of notifications from the delegate. If non-null, the filter argument will be used to select which notifications are delivered. The supplied object will also be passed to the recipient with each notification. This should not be modified by the broadcaster, but instead should be passed unmodified to the listener.

Parameters: listener the new listener, who will receive notifications from this broadcasting bean. filter a filter to determine which notifications are delivered to the listener, or null if no filtering is required. passback an object to be passed to the listener with each notification.

Throws: IllegalArgumentException if listener is null.

See Also: removeNotificationListener

getImplementationName

public String getImplementationName()
Returns the name of this Java Management eXtensions (JMX) implementation.

Returns: the implementation name.

getImplementationVendor

public String getImplementationVendor()
Returns the vendor of this Java Management eXtensions (JMX) implementation.

Returns: the implementation vendor.

getImplementationVersion

public String getImplementationVersion()
Returns the version of this Java Management eXtensions (JMX) implementation.

Returns: the implementation version.

getMBeanServerId

public String getMBeanServerId()
Returns the unique identifier for this management server.

Returns: the unique id of the server.

getNotificationInfo

public MBeanNotificationInfo[] getNotificationInfo()
Returns an array describing the notifications this bean may send to its registered listeners. Ideally, this array should be complete, but in some cases, this may not be possible. However, be aware that some listeners may expect this to be so.

Returns: the array of possible notifications.

getSpecificationName

public String getSpecificationName()
Returns the name of this Java Management eXtensions (JMX) specification.

Returns: the specification name.

getSpecificationVendor

public String getSpecificationVendor()
Returns the vendor of this Java Management eXtensions (JMX) specification.

Returns: the specification vendor.

getSpecificationVersion

public String getSpecificationVersion()
Returns the version of this Java Management eXtensions (JMX) specification.

Returns: the specification version.

removeNotificationListener

public void removeNotificationListener(NotificationListener listener)
Removes the specified listener from the list of recipients of notifications from this bean. This includes all combinations of filters and passback objects registered for this listener. For more specific removal of listeners, see {@link #removeNotificationListener(NotificationListener, NotificationFilter, java.lang.Object)}

Parameters: listener the listener to remove.

Throws: ListenerNotFoundException if the specified listener is not registered with this bean.

See Also: MBeanServerDelegate

removeNotificationListener

public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object passback)
Removes the specified listener from the list of recipients of notifications from this delegate. Only the first instance with the supplied filter and passback object is removed. null is used as a valid value for these parameters, rather than as a way to remove all registration instances for the specified listener; for this behaviour instead, see {@link #removeNotificationListener(NotificationListener)}.

Parameters: listener the listener to remove. filter the filter of the listener to remove. passback the passback object of the listener to remove.

Throws: ListenerNotFoundException if the specified listener is not registered with this bean.

See Also: MBeanServerDelegate removeNotificationListener

sendNotification

public void sendNotification(Notification notification)
Allows the server to use the delegate to send a notification. If the supplied notification has a sequence number <= 0, then it is replaced with the delegate's own sequence number.

Parameters: notification the notification to send.