KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > management > j2ee > Management


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package javax.management.j2ee;
25
26 import java.util.Set JavaDoc;
27
28 import javax.management.ObjectName JavaDoc;
29 import javax.management.QueryExp JavaDoc;
30 import javax.management.AttributeList JavaDoc;
31 import javax.management.Attribute JavaDoc;
32 import javax.management.MBeanInfo JavaDoc;
33 import javax.management.InstanceNotFoundException JavaDoc;
34 import javax.management.MBeanException JavaDoc;
35 import javax.management.AttributeNotFoundException JavaDoc;
36 import javax.management.ReflectionException JavaDoc;
37 import javax.management.InvalidAttributeValueException JavaDoc;
38 import javax.management.IntrospectionException JavaDoc;
39
40 import java.rmi.RemoteException JavaDoc;
41
42 /**
43  * The Management interface provides the APIs to navigate and manipulate
44  * managed objects. The J2EE Management EJB component (MEJB) must implement
45  * this as its remote interface.
46  *
47  * @author Hans Hrasna
48  */

49 public interface Management extends javax.ejb.EJBObject JavaDoc {
50
51     /**
52      * Gets the names of managed objects controlled by the MEJB. This method
53      * enables any of the following to be obtained: The names of all managed objects,
54      * the names of a set of managed objects specified by pattern matching on the
55      * <CODE>ObjectName</CODE>, a specific managed object name (equivalent to
56      * testing whether a managed object is registered). When the object name is
57      * null or no domain and key properties are specified, all objects are selected.
58      * It returns the set of J2EEObjectNames for the managed objects selected.
59      *
60      * @param name The object name pattern identifying the managed objects to be retrieved. If
61      * null or no domain and key properties are specified, all the managed objects registered will be retrieved.
62      *
63      * @return A set containing the ObjectNames for the managed objects selected.
64      * If no managed object satisfies the query, an empty set is returned.
65      *
66      * @exception RemoteException A communication exception occurred during the execution of a remote method call
67      */

68     Set JavaDoc queryNames(ObjectName JavaDoc name, QueryExp JavaDoc query) throws RemoteException JavaDoc;
69
70     /**
71      * Checks whether a managed object, identified by its object name, is already registered
72      * with the MEJB.
73      *
74      * @param name The object name of the managed object to be checked.
75      *
76      * @return True if the managed object is already registered in the MEJB, false otherwise.
77      *
78      * @exception RemoteException A communication exception occurred during the execution of a remote method call
79      */

80     boolean isRegistered(ObjectName JavaDoc name) throws RemoteException JavaDoc;
81
82     /**
83      * Returns the number of managed objects registered in the MEJB.
84      *
85      * @exception RemoteException A communication exception occurred during the execution of a remote method call
86      */

87     Integer JavaDoc getMBeanCount() throws RemoteException JavaDoc;
88
89     /**
90      * This method discovers the attributes and operations that a managed object exposes
91      * for management.
92      *
93      * @param name The name of the managed object to analyze
94      *
95      * @return An instance of <CODE>MBeanInfo</CODE> allowing the retrieval of all attributes and operations
96      * of this managed object.
97      *
98      * @exception IntrospectionException An exception occurs during introspection.
99      * @exception InstanceNotFoundException The managed object specified is not found.
100      * @exception ReflectionException An exception occurred when trying to perform reflection on a managed object
101      * @exception RemoteException A communication exception occurred during the execution of a remote method call
102      */

103     MBeanInfo JavaDoc getMBeanInfo(ObjectName JavaDoc name) throws IntrospectionException JavaDoc, InstanceNotFoundException JavaDoc, ReflectionException JavaDoc, RemoteException JavaDoc;
104
105     /**
106      * Gets the value of a specific attribute of a named managed object. The managed object
107      * is identified by its object name.
108      *
109      * @param name The object name of the managed object from which the attribute is to be retrieved.
110      * @param attribute A String specifying the name of the attribute to be
111      * retrieved.
112      *
113      * @return The value of the retrieved attribute.
114      *
115      * @exception AttributeNotFoundException The attribute specified is not accessible in the managed object.
116      * @exception MBeanException Wraps an exception thrown by the managed object's getter.
117      * @exception InstanceNotFoundException The managed object specified is not registered in the MEJB.
118      * @exception ReflectionException An exception occurred when trying to invoke the getAttribute method of a Dynamic MBean
119      * @exception RemoteException A communication exception occurred during the execution of a remote method call
120      */

121     Object JavaDoc getAttribute(ObjectName JavaDoc name, String JavaDoc attribute) throws MBeanException JavaDoc, AttributeNotFoundException JavaDoc, InstanceNotFoundException JavaDoc, ReflectionException JavaDoc, RemoteException JavaDoc;
122
123     /**
124      * Enables the values of several attributes of a named managed object. The managed object
125      * is identified by its object name.
126      *
127      * @param name The object name of the managed object from which the attributes are
128      * retrieved.
129      * @param attributes A list of the attributes to be retrieved.
130      *
131      * @return The list of the retrieved attributes.
132      *
133      * @exception InstanceNotFoundException The managed object specified is not registered in the MEJB.
134      * @exception ReflectionException An exception occurred when trying to invoke the getAttributes method of a Dynamic MBean.
135      * @exception RemoteException A communication exception occurred during the execution of a remote method call
136      */

137     AttributeList JavaDoc getAttributes(ObjectName JavaDoc name, String JavaDoc[] attributes) throws InstanceNotFoundException JavaDoc, ReflectionException JavaDoc, RemoteException JavaDoc;
138
139     /**
140      * Sets the value of a specific attribute of a named managed object. The managed object
141      * is identified by its object name.
142      *
143      * @param name The name of the managed object within which the attribute is to be set.
144      * @param attribute The identification of the attribute to be set and the value it is to be set to.
145      *
146      * @exception InstanceNotFoundException The managed object specified is not registered in the MEJB.
147      * @exception AttributeNotFoundException The attribute specified is not accessible in the managed object.
148      * @exception InvalidAttributeValueException The value specified for the attribute is not valid.
149      * @exception MBeanException Wraps an exception thrown by the managed object's setter.
150      * @exception ReflectionException An exception occurred when trying to invoke the setAttribute method of a Dynamic MBean.
151      * @exception RemoteException A communication exception occurred during the execution of a remote method call
152      */

153     void setAttribute(ObjectName JavaDoc name, Attribute JavaDoc attribute) throws InstanceNotFoundException JavaDoc, AttributeNotFoundException JavaDoc, InvalidAttributeValueException JavaDoc, MBeanException JavaDoc, ReflectionException JavaDoc, RemoteException JavaDoc;
154
155     /**
156      * Sets the values of several attributes of a named managed object. The managed object is
157      * identified by its object name.
158      *
159      * @param name The object name of the managed object within which the attributes are to
160      * be set.
161      * @param attributes A list of attributes: The identification of the
162      * attributes to be set and the values they are to be set to.
163      *
164      * @return The list of attributes that were set, with their new values.
165      *
166      * @exception InstanceNotFoundException The managed object specified is not registered in the MEJB.
167      * @exception ReflectionException An exception occurred when trying to invoke the setAttributes method of a Dynamic MBean.
168      * @exception RemoteException A communication exception occurred during the execution of a remote method call
169      *
170      */

171     AttributeList JavaDoc setAttributes(ObjectName JavaDoc name, AttributeList JavaDoc attributes) throws InstanceNotFoundException JavaDoc, ReflectionException JavaDoc, RemoteException JavaDoc;
172
173     /**
174      * Invokes an operation on a managed object.
175      *
176      * @param name The object name of the managed object on which the method is to be invoked.
177      * @param operationName The name of the operation to be invoked.
178      * @param params An array containing the parameters to be set when the operation is
179      * invoked
180      * @param signature An array containing the signature of the operation. The class objects will
181      * be loaded using the same class loader as the one used for loading the managed object on which the operation was invoked.
182      *
183      * @return The object returned by the operation, which represents the result of invoking the operation on the
184      * managed object specified.
185      *
186      * @exception InstanceNotFoundException The managed object specified is not registered in the MEJB.
187      * @exception MBeanException Wraps an exception thrown by the managed object's invoked method.
188      * @exception ReflectionException Wraps a <CODE>java.lang.Exception</CODE> thrown while trying to invoke the method.
189      * @exception RemoteException A communication exception occurred during the execution of a remote method call
190      */

191     Object JavaDoc invoke(ObjectName JavaDoc name, String JavaDoc operationName, Object JavaDoc[] params, String JavaDoc[] signature) throws InstanceNotFoundException JavaDoc, MBeanException JavaDoc, ReflectionException JavaDoc, RemoteException JavaDoc;
192
193     /**
194      * Returns the default domain name of this MEJB.
195      * @exception RemoteException A communication exception occurred during the execution of a remote method call
196      */

197     String JavaDoc getDefaultDomain() throws RemoteException JavaDoc;
198
199    /**
200     * Returns the listener registry implementation for this MEJB. The listener registry implements the methods
201     * that enable clints to add and remove event notification listeners managed objects
202     * @return An implementation of <CODE>javax.management.j2ee.ListenerRegistration</CODE>
203     *
204     * @exception RemoteException A communication exception occurred during the execution of a remote method call
205     */

206     ListenerRegistration JavaDoc getListenerRegistry() throws RemoteException JavaDoc;
207
208 }
209
Popular Tags