KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > management > agent > IIOPMBeanServer


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 com.sun.enterprise.management.agent;
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 import javax.management.MBeanRegistrationException JavaDoc;
40
41 import java.rmi.RemoteException JavaDoc;
42 import javax.ejb.EJBObject JavaDoc;
43 import javax.management.j2ee.ListenerRegistration JavaDoc;
44
45 public interface IIOPMBeanServer extends java.rmi.Remote JavaDoc {
46
47     /**
48      * Gets the names of managed objects controlled by the MEJB. This method
49      * enables any of the following to be obtained: The names of all managed objects,
50      * the names of a set of managed objects specified by pattern matching on the
51      * <CODE>ObjectName</CODE>, a specific managed object name (equivalent to
52      * testing whether an managed object is registered). When the object name is
53      * null or no domain and key properties are specified, all objects are selected.
54      * It returns the set of J2EEObjectNames for the managed objects selected.
55      *
56      * @param name The object name pattern identifying the managed objects to be retrieved. If
57      * null or no domain and key properties are specified, all the managed objects registered will be retrieved.
58      *
59      * @return A set containing the J2EEObjectNames for the managed objects selected.
60      * If no managed object satisfies the query, an empty list is returned.
61      *
62      */

63     Set JavaDoc queryNames(ObjectName JavaDoc name, QueryExp JavaDoc query) throws RemoteException JavaDoc;
64
65     /**
66      * Checks whether an managed object, identified by its object name, is already registered
67      * with the MEJB.
68      *
69      * @param name The object name of the managed object to be checked.
70      *
71      * @return True if the managed object is already registered in the MEJB, false otherwise.
72      *
73      * @exception RuntimeOperationsException Wraps a <CODE>java.lang.IllegalArgumentException</CODE>: The object name in parameter is null.
74      * @BM_EXPOSED
75      * @BUSINESSMETHOD
76      *
77      */

78     boolean isRegistered(ObjectName JavaDoc name) throws RemoteException JavaDoc;
79
80     /**
81      * Returns the number of managed objects registered in the MEJB.
82      * @BM_EXPOSED
83      * @BUSINESSMETHOD
84      */

85     Integer JavaDoc getMBeanCount() throws RemoteException JavaDoc;
86
87           /**
88      * This method discovers the attributes and operations that an managed object exposes
89      * for management.
90      *
91      * @param name The name of the managed object to analyze
92      *
93      * @return An instance of <CODE>MBeanInfo</CODE> allowing the retrieval of all attributes and operations
94      * of this managed object.
95      *
96      * @exception IntrospectionException An exception occurs during introspection.
97      * @exception InstanceNotFoundException The managed object specified is not found.
98      */

99     MBeanInfo JavaDoc getMBeanInfo(ObjectName JavaDoc name) throws InstanceNotFoundException JavaDoc, IntrospectionException JavaDoc, ReflectionException JavaDoc , RemoteException JavaDoc;
100
101     /**
102      * Gets the value of a specific attribute of a named managed object. The managed object
103      * is identified by its object name.
104      *
105      * @param name The object name of the managed object from which the attribute is to be retrieved.
106      * @param attribute A String specifying the name of the attribute to be
107      * retrieved.
108      *
109      * @return The value of the retrieved attribute.
110      *
111      * @exception AttributeNotFoundException The attribute specified is not accessible in the managed object.
112      * @exception MBeanException Wraps an exception thrown by the managed object's getter.
113      * @exception InstanceNotFoundException The managed object specified is not registered in the MEJB.
114      * @exception ReflectionException Wraps a <CODE>java.lang.Exception</CODE> thrown when trying to invoke the setter.
115      * @exception RuntimeOperationsException Wraps a <CODE>java.lang.IllegalArgumentException</CODE>: The object name in parameter is null or
116      * the attribute in parameter is null.
117      * @BM_EXPOSED
118      * @BUSINESSMETHOD
119      */

120     Object JavaDoc getAttribute(ObjectName JavaDoc name, String JavaDoc attribute) throws
121     AttributeNotFoundException JavaDoc, MBeanException 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 managed object.
135      * @exception RuntimeOperationsException Wrap a <CODE>java.lang.IllegalArgumentException</CODE>: The object name in parameter is null or
136      * attributes in parameter is null.
137      * @BM_EXPOSED
138      * @BUSINESSMETHOD
139      *
140      */

141     AttributeList JavaDoc getAttributes(ObjectName JavaDoc name, String JavaDoc[] attributes)
142         throws InstanceNotFoundException JavaDoc, ReflectionException JavaDoc, RemoteException JavaDoc;
143
144     /**
145      * Sets the value of a specific attribute of a named managed object. The managed object
146      * is identified by its object name.
147      *
148      * @param name The name of the managed object within which the attribute is to be set.
149      * @param attribute The identification of the attribute to be set and the value it is to be set to.
150      *
151      * @return The value of the attribute that has been set.
152      *
153      * @exception InstanceNotFoundException The managed object specified is not registered in the MEJB.
154      * @exception AttributeNotFoundException The attribute specified is not accessible in the managed object.
155      * @exception InvalidAttributeValueException The value specified for the attribute is not valid.
156      * @exception MBeanException Wraps an exception thrown by the managed object's setter.
157      * @exception ReflectionException Wraps a <CODE>java.lang.Exception</CODE> thrown when trying to invoke the setter.
158      * @exception RuntimeOperationsException Wraps a <CODE>java.lang.IllegalArgumentException</CODE>: The object name in parameter is null or
159      * the attribute in parameter is null.
160      * @BM_EXPOSED
161      * @BUSINESSMETHOD
162      */

163     void setAttribute(ObjectName JavaDoc name, Attribute JavaDoc attribute) throws
164        InstanceNotFoundException JavaDoc, AttributeNotFoundException JavaDoc, InvalidAttributeValueException JavaDoc,
165        MBeanException JavaDoc, ReflectionException JavaDoc, RemoteException JavaDoc;
166
167     /**
168      * Sets the values of several attributes of a named managed object. The managed object is
169      * identified by its object name.
170      *
171      * @param name The object name of the managed object within which the attributes are to
172      * be set.
173      * @param attributes A list of attributes: The identification of the
174      * attributes to be set and the values they are to be set to.
175      *
176      * @return The list of attributes that were set, with their new values.
177      *
178      * @exception InstanceNotFoundException The managed object specified is not registered in the MEJB.
179      * @exception ReflectionException An exception occurred when trying to invoke the getAttributes method of a Dynamic managed object.
180      * @exception RuntimeOperationsException Wraps a <CODE>java.lang.IllegalArgumentException</CODE>: The object name in parameter is null or
181      * attributes in parameter is null.
182      * @BM_EXPOSED
183      * @BUSINESSMETHOD
184      *
185      */

186     AttributeList JavaDoc setAttributes(ObjectName JavaDoc name, AttributeList JavaDoc attributes)
187         throws InstanceNotFoundException JavaDoc, ReflectionException JavaDoc, RemoteException JavaDoc;
188
189     /**
190      * Invokes an operation on an managed object.
191      *
192      * @param name The object name of the managed object on which the method is to be invoked.
193      * @param operationName The name of the operation to be invoked.
194      * @param params An array containing the parameters to be set when the operation is
195      * invoked
196      * @param signature An array containing the signature of the operation. The class objects will
197      * be loaded using the same class loader as the one used for loading the managed object on which the operation was invoked.
198      *
199      * @return The object returned by the operation, which represents the result ofinvoking the operation on the
200      * managed object specified.
201      *
202      * @exception InstanceNotFoundException The managed object specified is not registered in the MEJB.
203      * @exception MBeanException Wraps an exception thrown by the managed object's invoked method.
204      * @exception ReflectionException Wraps a <CODE>java.lang.Exception</CODE> thrown while trying to invoke the method.
205      * @BM_EXPOSED
206      * @BUSINESSMETHOD
207      *
208      */

209     Object JavaDoc invoke(ObjectName JavaDoc name, String JavaDoc operationName, Object JavaDoc[] params,
210                          String JavaDoc[] signature) throws InstanceNotFoundException JavaDoc, MBeanException JavaDoc, ReflectionException JavaDoc, RemoteException JavaDoc;
211
212     /**
213      * Returns the domain name of this MEJB.
214      */

215     String JavaDoc getDefaultDomain() throws RemoteException JavaDoc;
216
217     /**
218      * De-registers an MBean from the MBean server. The MBean is identified by
219      * its object name. Once the method has been invoked, the MBean may no longer be accessed by its object name.
220      * @param name The object name of the MBean to be de-registered.
221      * @exception InstanceNotFoundException The MBean specified is not registered in the MBean server.
222      * @exception MBeanRegistrationException The preDeregister ((<CODE>MBeanRegistration</CODE> interface) method of the MBean
223      * has thrown an exception.
224      * @exception RuntimeOperationsException Wraps a <CODE>java.lang.IllegalArgumentException</CODE>: The object name in
225      * parameter is null or the MBean you are when trying to de-register is the {@link javax.management.MBeanServerDelegate
226      * MBeanServerDelegate} MBean.
227      */

228     public void unregisterMBean(ObjectName JavaDoc name) throws InstanceNotFoundException JavaDoc,
229         MBeanRegistrationException JavaDoc, RemoteException JavaDoc;
230
231 }
232
Popular Tags