javax.management

Class MBeanServerDelegate

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, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

MBeanServerDelegate

public MBeanServerDelegate()
Default constructor which generates the id.

Method Details

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.

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,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.

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.

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.

MBeanServerDelegate.java -- The management server delegate. Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.