KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mx4j > server > interceptor > MBeanServerInterceptor


1 /*
2  * Copyright (C) The MX4J Contributors.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the MX4J License version 1.0.
6  * See the terms of the MX4J License in the documentation provided with this software.
7  */

8
9 package mx4j.server.interceptor;
10
11 import java.util.List JavaDoc;
12 import javax.management.Attribute JavaDoc;
13 import javax.management.AttributeList JavaDoc;
14 import javax.management.AttributeNotFoundException JavaDoc;
15 import javax.management.InvalidAttributeValueException JavaDoc;
16 import javax.management.ListenerNotFoundException JavaDoc;
17 import javax.management.MBeanException JavaDoc;
18 import javax.management.MBeanInfo JavaDoc;
19 import javax.management.MBeanRegistrationException JavaDoc;
20 import javax.management.NotificationFilter JavaDoc;
21 import javax.management.NotificationListener JavaDoc;
22 import javax.management.ReflectionException JavaDoc;
23
24 import mx4j.server.MBeanMetaData;
25
26 /**
27  * MBeanServer --> MBean interceptor.
28  * These interceptors are used internally to implement MBeanServer functionality prior to call
29  * MBeans, and can be used to customize MBeanServer implementation by users.
30  *
31  * @version $Revision: 1.6 $
32  */

33 public interface MBeanServerInterceptor
34 {
35    /**
36     * Constant used to specify the status of the MBean registration in {@link #registration}
37     */

38    public static final int PRE_REGISTER = 1;
39    /**
40     * Constant used to specify the status of the MBean registration in {@link #registration}
41     */

42    public static final int POST_REGISTER_TRUE = 2;
43    /**
44     * Constant used to specify the status of the MBean registration in {@link #registration}
45     */

46    public static final int POST_REGISTER_FALSE = 3;
47    /**
48     * Constant used to specify the status of the MBean registration in {@link #registration}
49     */

50    public static final int PRE_DEREGISTER = 4;
51    /**
52     * Constant used to specify the status of the MBean registration in {@link #registration}
53     */

54    public static final int POST_DEREGISTER = 5;
55
56    /**
57     * A concise string that tells the type of this interceptor
58     */

59    public String JavaDoc getType();
60
61    /**
62     * Sets the chain of interceptors on this interceptor. This interceptor will use this list to
63     * find the interceptor in the chain after itself
64     *
65     * @param interceptors The list of interceptors
66     */

67    public void setChain(List JavaDoc interceptors);
68
69    /**
70     * Adds the given notification listener to the MBean, along with the given filter and handback
71     */

72    public void addNotificationListener(MBeanMetaData metadata, NotificationListener JavaDoc listener, NotificationFilter JavaDoc filter, Object JavaDoc handback);
73
74    /**
75     * Removes the given notification listener from the MBean.
76     */

77    public void removeNotificationListener(MBeanMetaData metadata, NotificationListener JavaDoc listener) throws ListenerNotFoundException JavaDoc;
78
79    /**
80     * Removes the given notification listener from the MBean, specified by the given filter and handback.
81     */

82    public void removeNotificationListener(MBeanMetaData metadata, NotificationListener JavaDoc listener, NotificationFilter JavaDoc filter, Object JavaDoc handback) throws ListenerNotFoundException JavaDoc;
83
84    /**
85     * Instantiate the given className passing the given arguments to the constructor with the given signature
86     */

87    public void instantiate(MBeanMetaData metadata, String JavaDoc className, String JavaDoc[] params, Object JavaDoc[] args) throws ReflectionException JavaDoc, MBeanException JavaDoc;
88
89    /**
90     * Calls the specified {@link javax.management.MBeanRegistration} method on the MBean instance.
91     */

92    public void registration(MBeanMetaData metadata, int operation) throws MBeanRegistrationException JavaDoc;
93
94    /**
95     * Calls getMBeanInfo on the MBean instance (only on DynamicMBeans).
96     */

97    public MBeanInfo JavaDoc getMBeanInfo(MBeanMetaData metadata);
98
99    /**
100     * Invokes the specified MBean operation on the MBean instance
101     */

102    public Object JavaDoc invoke(MBeanMetaData metadata, String JavaDoc method, String JavaDoc[] params, Object JavaDoc[] args) throws MBeanException JavaDoc, ReflectionException JavaDoc;
103
104    /**
105     * Gets the specified attributes values from the MBean instance.
106     */

107    public AttributeList JavaDoc getAttributes(MBeanMetaData metadata, String JavaDoc[] attributes);
108
109    /**
110     * Sets the specified attributes values on the MBean instance.
111     */

112    public AttributeList JavaDoc setAttributes(MBeanMetaData metadata, AttributeList JavaDoc attributes);
113
114    /**
115     * Gets the specified attribute value from the MBean instance.
116     */

117    public Object JavaDoc getAttribute(MBeanMetaData metadata, String JavaDoc attribute) throws MBeanException JavaDoc, AttributeNotFoundException JavaDoc, ReflectionException JavaDoc;
118
119    /**
120     * Sets the specified attribute value on the MBean instance.
121     */

122    public void setAttribute(MBeanMetaData metadata, Attribute JavaDoc attribute) throws MBeanException JavaDoc, AttributeNotFoundException JavaDoc, InvalidAttributeValueException JavaDoc, ReflectionException JavaDoc;
123 }
124
Popular Tags