KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > management > MBeanServerNotification


1 /*
2  * @(#)MBeanServerNotification.java 4.24 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.management;
9
10
11 /**
12  * Represents a notification emitted by the MBean server through the MBeanServerDelegate MBean.
13  * The MBean Server emits the following types of notifications: MBean registration, MBean
14  * de-registration.
15  * <P>
16  * To receive to MBeanServerNotifications, you need to be declared as listener to
17  * the {@link javax.management.MBeanServerDelegate javax.management.MBeanServerDelegate} MBean
18  * that represents the MBeanServer. The ObjectName of the MBeanServerDelegate is:
19  * <CODE>JMImplementation:type=MBeanServerDelegate</CODE>.
20  *
21  * @since 1.5
22  */

23  public class MBeanServerNotification extends Notification JavaDoc {
24      
25
26      /* Serial version */
27      private static final long serialVersionUID = 2876477500475969677L;
28
29      /**
30       * Notification type denoting that an MBean has been registered. Value is "JMX.mbean.registered".
31       */

32      public static final String JavaDoc REGISTRATION_NOTIFICATION = "JMX.mbean.registered" ;
33      
34      /**
35       * Notification type denoting that an MBean has been unregistered. Value is "JMX.mbean.unregistered".
36       */

37      public static final String JavaDoc UNREGISTRATION_NOTIFICATION = "JMX.mbean.unregistered" ;
38           
39
40      /**
41       * @serial The object names of the MBeans concerned by this notification
42       */

43      private final ObjectName JavaDoc objectName;
44      
45
46      /**
47       * Creates an MBeanServerNotification object specifying object names of
48       * the MBeans that caused the notification and the specified notification type.
49       *
50       * @param type A string denoting the type of the
51       * notification. Set it to one these values: {@link
52       * #REGISTRATION_NOTIFICATION}, {@link
53       * #UNREGISTRATION_NOTIFICATION}.
54       * @param source The MBeanServerNotification object responsible
55       * for forwarding MBean server notification.
56       * @param sequenceNumber A sequence number that can be used to order
57       * received notifications.
58       * @param objectName The object name of the MBean that caused the notification.
59       *
60       */

61      public MBeanServerNotification(String JavaDoc type, Object JavaDoc source, long sequenceNumber, ObjectName JavaDoc objectName ) {
62      super (type,source,sequenceNumber) ;
63      this.objectName = objectName ;
64      }
65      
66      /**
67       * Returns the object name of the MBean that caused the notification.
68       *
69       * @return the object name of the MBean that caused the notification.
70       */

71      public ObjectName JavaDoc getMBeanName() {
72      return objectName ;
73      }
74
75  }
76
Popular Tags