KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > system > ListenerServiceMBean


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.system;
23
24 /**
25  * An extension of the ServiceMBean interface that provides for
26  * declarative JMX notification subscription handling.
27  * <p>
28  * The SubscriptionList attribute is used to specify the list
29  * of MBeans/notifications that the listener service instance
30  * will subscribe for.
31  * <p>
32  * The abstract class ListenerServiceMBeanSupport implements
33  * this interface.
34  *
35  * @see ServiceMBean
36  * @see ListenerServiceMBeanSupport
37  *
38  * @author <a HREF="mailto:dimitris@jboss.org">Dimitris Andreadis</a>
39  * @version $Revision: 57108 $
40 **/

41 public interface ListenerServiceMBean
42    extends ServiceMBean
43 {
44    // Constants -----------------------------------------------------
45

46    /** The XML subscription-list elements and attributes */
47    public static final String JavaDoc SL_ROOT_ELEMENT = "subscription-list";
48    public static final String JavaDoc SL_MBEAN_ELEMENT = "mbean";
49    public static final String JavaDoc SL_FILTER_ELEMENT = "filter";
50    public static final String JavaDoc SL_NOTIFICATION_ELEMENT = "notification";
51    public static final String JavaDoc SL_MBEAN_NAME_ATTRIBUTE = "name";
52    public static final String JavaDoc SL_MBEAN_HANDBACK_ATTRIBUTE = "handback";
53    public static final String JavaDoc SL_FILTER_FACTORY_ATTRIBUTE = "factory";
54    public static final String JavaDoc SL_NOTIFICATION_TYPE_ATTRIBUTE = "type";
55    
56    // Public --------------------------------------------------------
57

58    /**
59     * Used to configure at start-up the JMX notification subscriptions.
60     *
61     * The configuration is done inline in the mbean descriptor. For example:
62     *
63     * <code>
64     * ...
65     * <attribute name="SubscriptionList">
66     * <subscription-list>
67     * <mbean name="jboss.system:*">
68     * <notification type="org.jboss.system.ServiceMBean.start"/>
69     * <notification type="org.jboss.system.ServiceMBean.stop"/>
70     * </mbean>
71     * </subscription-list>
72     * </attribute>
73     * ...
74     * </code>
75     *
76     * The filter mechanism has been extended to support specification
77     * of arbitrary filters, using filter factory plugins:
78     *
79     * <code>
80     * ...
81     * <attribute name="SubscriptionList">
82     * <subscription-list>
83     * <mbean name="jboss.system:*">
84     * <filter factory="NotificationFilterSupportFactory">
85     * <enable type="org.jboss.system.ServiceMBean.start"/>
86     * <enable type="org.jboss.system.ServiceMBean.stop"/>
87     * </filter>
88     * </mbean>
89     * <mbean name="jboss.monitor:service=MemoryMonitor">
90     * <filter factory="AttributeChangeNotificationFilterFactory">
91     * <enable attribute-name="State"/>
92     * </filter>
93     * </mbean>
94     * <mbean name="JMImplementation:type=MBeanServerDelegate">
95     * <filter factory="MBeanServerNotificationFilterFactory">
96     * <enable type="JMX.mbean"/>
97     * <enable object-name="jboss:type=Service,name=SystemProperties"/>
98     * </filter>
99     * </mbean>
100     * </subscription-list>
101     * </attribute>
102     * ...
103     * </code>
104     *
105     * 'factory' is the full class name of a class that implements the
106     * org.jboss.system.NotificationFilterFactory interface. If the
107     * class cannot be loaded, a second attempt is made to load the
108     * class from within the org.jboss.system.filterfactory package.
109     *
110     * Three NotificationFilterFactories corresponding to the three
111     * "standard" jmx notification filters, have been pre-packaged.
112     *
113     * Those are:
114     *
115     * @see org.jboss.system.filterfactory.AttributeChangeNotificationFilterFactory
116     * @see org.jboss.system.filterfactory.MBeanServerNotificationFilterFactory
117     * @see org.jboss.system.filterfactory.NotificationFilterSupportFactory
118     *
119     * See also jboss-subscription.dtd
120    **/

121    public void setSubscriptionList(org.w3c.dom.Element JavaDoc list);
122    
123 }
124
Popular Tags