/**
* The XMOJO Project 5
* Copyright 2003 XMOJO.org. All rights reserved.
* NO WARRANTY
* BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
* THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
* OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
* PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
* OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
* TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE
* LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
* REPAIR OR CORRECTION.
* IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL
* ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE
* THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
* GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
* USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF
* DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
* PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE),
* EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGES.
**/
package javax.management;
/**
* The MBeanServerNotification class represents an notification emitted by the
* MBean Server. The MBean Server emits these types of notifications:
* MBean registration, MBean de-registration.
* <P>
* To receive to MBeanServerNotifications, you need to be declared as listener
* to the {@link javax.management.MBeanServerDelegate
* javax.management.MBeanServerDelegate} MBean that represents the MBeanServer.
* The ObjectName of the MBeanServerDelegate is:
* <CODE>JMImplementation:type=MBeanServerDelegate</CODE>.
*/
public class MBeanServerNotification extends Notification
{
/**
* Notification type denoting that a MBean has been registered. Value is
* "JMX.mbean.registered".
*/
public static final String REGISTRATION_NOTIFICATION = "JMX.mbean.registered";
/**
* Notification type denoting that a MBean has been uregsitered. Value is
* "JMX.mbean.unregistered".
*/
public static final String UNREGISTRATION_NOTIFICATION = "JMX.mbean.unregistered";
/** The object names of the MBeans concerned by this notification */
private ObjectName objectName = null;
/**
* Creates a MBeanServerNotification object with specified object names of
* the MBeans that caused the notification and the specified notification type.
*
* @param type A string denoting the type of the notification. Set it to
* one these values:
* REGISTRATION_NOTIFICATION, UNREGISTRATION_NOTIFICATION
*
* @param source The MBeanServerNotification object responsible to
* forward MBeanServer notification.
*
* @param sequenceNumber The notification sequence number within
* the source object
*
* @param objectNames A list of the object names of the MBeans that
* caused the notification.
*/
public MBeanServerNotification(String type, Object source,
long sequenceNumber, ObjectName objectName)
{
super(type, source, sequenceNumber);
this.objectName = objectName;
}
/**
* Returns object name of the MBean that caused the notification
*
* @return This returns name of the MBean that caused the notification
*/
public ObjectName getMBeanName()
{
return objectName;
}
}
|