javax.management
Class MBeanServerDelegate

java.lang.Object
  extended by javax.management.MBeanServerDelegate
All Implemented Interfaces:
MBeanServerDelegateMBean, NotificationBroadcaster, NotificationEmitter

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
 void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object passback)
          Registers the specified listener as a new recipient of notifications from the delegate.
 String getImplementationName()
          Returns the name of this Java Management eXtensions (JMX) implementation.
 String getImplementationVendor()
          Returns the vendor of this Java Management eXtensions (JMX) implementation.
 String getImplementationVersion()
          Returns the version of this Java Management eXtensions (JMX) implementation.
 String getMBeanServerId()
          Returns the unique identifier for this management server.
 MBeanNotificationInfo[] getNotificationInfo()
          Returns an array describing the notifications this bean may send to its registered listeners.
 String getSpecificationName()
          Returns the name of this Java Management eXtensions (JMX) specification.
 String getSpecificationVendor()
          Returns the vendor of this Java Management eXtensions (JMX) specification.
 String getSpecificationVersion()
          Returns the version of this Java Management eXtensions (JMX) specification.
 void removeNotificationListener(NotificationListener listener)
          Removes the specified listener from the list of recipients of notifications from this bean.
 void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object passback)
          Removes the specified listener from the list of recipients of notifications from this delegate.
 void sendNotification(Notification notification)
          Allows the server to use the delegate to send a notification.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MBeanServerDelegate

public MBeanServerDelegate()
Default constructor which generates the id.

Method Detail

addNotificationListener

public void addNotificationListener(NotificationListener listener,
                                    NotificationFilter filter,
                                    Object passback)
                             throws IllegalArgumentException
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.

Specified by:
addNotificationListener in interface NotificationBroadcaster
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(NotificationListener)

getImplementationName

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

Specified by:
getImplementationName in interface MBeanServerDelegateMBean
Returns:
the implementation name.

getImplementationVendor

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

Specified by:
getImplementationVendor in interface MBeanServerDelegateMBean
Returns:
the implementation vendor.

getImplementationVersion

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

Specified by:
getImplementationVersion in interface MBeanServerDelegateMBean
Returns:
the implementation version.

getMBeanServerId

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

Specified by:
getMBeanServerId in interface MBeanServerDelegateMBean
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.

Specified by:
getNotificationInfo in interface NotificationBroadcaster
Returns:
the array of possible notifications.

getSpecificationName

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

Specified by:
getSpecificationName in interface MBeanServerDelegateMBean
Returns:
the specification name.

getSpecificationVendor

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

Specified by:
getSpecificationVendor in interface MBeanServerDelegateMBean
Returns:
the specification vendor.

getSpecificationVersion

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

Specified by:
getSpecificationVersion in interface MBeanServerDelegateMBean
Returns:
the specification version.

removeNotificationListener

public void removeNotificationListener(NotificationListener listener)
                                throws ListenerNotFoundException
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 removeNotificationListener(NotificationListener, NotificationFilter, java.lang.Object)

Specified by:
removeNotificationListener in interface NotificationBroadcaster
Parameters:
listener - the listener to remove.
Throws:
ListenerNotFoundException - if the specified listener is not registered with this bean.
See Also:
addNotificationListener(NotificationListener, NotificationFilter, java.lang.Object)

removeNotificationListener

public void removeNotificationListener(NotificationListener listener,
                                       NotificationFilter filter,
                                       Object passback)
                                throws ListenerNotFoundException
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 removeNotificationListener(NotificationListener).

Specified by:
removeNotificationListener in interface NotificationEmitter
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:
addNotificationListener(NotificationListener, NotificationFilter, java.lang.Object), removeNotificationListener(NotificationListener)

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.