KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > mejb > DomainManagement


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 2005 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id$
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.jonas.mejb;
27
28 import java.rmi.RemoteException JavaDoc;
29 import java.util.Set JavaDoc;
30
31 import javax.management.Attribute JavaDoc;
32 import javax.management.AttributeList JavaDoc;
33 import javax.management.AttributeNotFoundException JavaDoc;
34 import javax.management.InstanceNotFoundException JavaDoc;
35 import javax.management.IntrospectionException JavaDoc;
36 import javax.management.InvalidAttributeValueException JavaDoc;
37 import javax.management.MBeanException JavaDoc;
38 import javax.management.MBeanInfo JavaDoc;
39 import javax.management.ObjectName JavaDoc;
40 import javax.management.QueryExp JavaDoc;
41 import javax.management.ReflectionException JavaDoc;
42 import javax.management.j2ee.Management JavaDoc;
43
44 /**
45  * This is a variation on the javax.management.j2ee.Management interface
46  * required to be exposed by JOnAS through the MEJB session bean. This extends
47  * the main functionality of the MEJB session bean by allowing clients to query
48  * mbean information from other servers within the same domain.<br/><br/>
49  * Please Note: <code>domainServerName</code> in any of the exposed methods
50  * can be set to one of the values of the array returned by the following call
51  * to a <i> master</i> server:
52  * <code> getAttribute(null, domainObjectName, "serverNames")
53  * </code> where
54  * <code>ObjectName domainObjectName</code> corresponds to the ObjectName:
55  * <i>domainName</i>:j2eeType=J2EEDomain,name=<i>domainName</i>
56  *
57  * @author Vivek Lakshmanan
58  */

59 public interface DomainManagement extends Management JavaDoc {
60
61     /**
62      * Gets the value of a specified attribute inside the mbean corresponding to
63      * the objectname <code>name</code> for the server with name
64      * <code> domainServerName </code>.
65      *
66      * @param domainServerName
67      * Name of the server in domain. Use <code>null</code> for
68      * referring to this server.
69      * @param name
70      * ObjectName corresponding to the MBean to query.
71      * @param attribute
72      * The member attribute to be queried.
73      * @return Value of the attribute.
74      * @throws MBeanException
75      * @throws AttributeNotFoundException
76      * @throws InstanceNotFoundException
77      * @throws ReflectionException
78      * @throws RemoteException
79      */

80     Object JavaDoc getAttribute(String JavaDoc domainServerName, ObjectName JavaDoc name,
81             String JavaDoc attribute) throws MBeanException JavaDoc,
82             AttributeNotFoundException JavaDoc, InstanceNotFoundException JavaDoc,
83             ReflectionException JavaDoc, RemoteException JavaDoc;
84
85     /**
86      * Gets the values of attributes in <code>attributes</code> inside the
87      * mbean corresponding to the objectname <code>name</code> for the server
88      * with name <code>domainServerName</code>.
89      *
90      * @param domainServerName
91      * Name of the server in domain. Use <code>null</code> for
92      * referring to this server.
93      * @param name
94      * ObjectName corresponding to the MBean to query.
95      * @param attributes
96      * Array of attribute names to be queried.
97      * @return Value of the attributes.
98      * @throws InstanceNotFoundException
99      * @throws ReflectionException
100      * @throws RemoteException
101      */

102     AttributeList JavaDoc getAttributes(String JavaDoc domainServerName, ObjectName JavaDoc name,
103             String JavaDoc[] attributes) throws InstanceNotFoundException JavaDoc,
104             ReflectionException JavaDoc, RemoteException JavaDoc;
105
106     /**
107      * The number of MBeans registered in the mbean server corresponding to the
108      * server <code>domainServerName</code> in the domain.
109      *
110      * @param domainServerName
111      * Name of the server in domain. Use <code>null</code> for
112      * referring to this server.
113      * @return Number of MBeans currently registered in server.
114      * @throws MBeanException
115      * @throws AttributeNotFoundException
116      * @throws InstanceNotFoundException
117      * @throws ReflectionException
118      * @throws RemoteException
119      */

120     Integer JavaDoc getMBeanCount(String JavaDoc domainServerName) throws MBeanException JavaDoc,
121             AttributeNotFoundException JavaDoc, InstanceNotFoundException JavaDoc,
122             ReflectionException JavaDoc, RemoteException JavaDoc;
123
124     /**
125      * Get information about a specific MBean with ObjectName <code>name</code>
126      * registered on server <code>domainServerName</code>.
127      *
128      * @param domainServerName
129      * Name of the server in domain. Use <code>null</code> for
130      * referring to this server.
131      * @param name
132      * ObjectName corresponding to the MBean to query.
133      * @return Information about queried MBean.
134      * @throws IntrospectionException
135      * @throws InstanceNotFoundException
136      * @throws ReflectionException
137      * @throws RemoteException
138      */

139     MBeanInfo JavaDoc getMBeanInfo(String JavaDoc domainServerName, ObjectName JavaDoc name)
140             throws IntrospectionException JavaDoc, InstanceNotFoundException JavaDoc,
141             ReflectionException JavaDoc, RemoteException JavaDoc;
142
143     /**
144      * Invoke an operation on an MBean with ObjectName <code>name</code>.
145      *
146      * @param domainServerName
147      * Name of the server in domain. Use <code>null</code> for
148      * referring to this server.
149      * @param name
150      * ObjectName corresponding to the MBean to query.
151      * @param operationName
152      * Name of operation to invoke.
153      * @param params
154      * Parameters to pass to the operation.
155      * @param signature
156      * Signature of operation.
157      * @return Result of invocation.
158      * @throws MBeanException
159      * @throws InstanceNotFoundException
160      * @throws ReflectionException
161      * @throws RemoteException
162      */

163     Object JavaDoc invoke(String JavaDoc domainServerName, ObjectName JavaDoc name,
164             String JavaDoc operationName, Object JavaDoc[] params, String JavaDoc[] signature)
165             throws MBeanException JavaDoc, InstanceNotFoundException JavaDoc,
166             ReflectionException JavaDoc, RemoteException JavaDoc;
167
168     /**
169      * Check if the MBean with ObjectName <code>name</code> is registered in
170      * the server with the name <code>domainServerName</code>.
171      *
172      * @param domainServerName
173      * Name of the server in domain. Use <code>null</code> for
174      * referring to this server.
175      * @param name
176      * ObjectName corresponding to the MBean to query.
177      * @return <code>true</code> if registered.
178      * @throws RemoteException
179      */

180     boolean isRegistered(String JavaDoc domainServerName, ObjectName JavaDoc name)
181             throws RemoteException JavaDoc;
182
183     /**
184      * Query for ObjectNames on the server named <code>domainServerName</code>based
185      * on a query string.
186      *
187      * @param domainServerName
188      * Name of the server in domain. Use <code>null</code> for
189      * referring to this server.
190      * @param name
191      * ObjectName corresponding to the query string.
192      * @param query
193      * Query expression to apply on ObjectName.
194      * @return MBeans matching the query.
195      * @throws RemoteException
196      */

197     Set JavaDoc queryNames(String JavaDoc domainServerName, ObjectName JavaDoc name, QueryExp JavaDoc query)
198             throws RemoteException JavaDoc;
199
200     /**
201      * Sets the value of a specified attribute inside the mbean corresponding to
202      * the objectname <code>name</code> for the server with name
203      * <code> domainServerName </code>.
204      *
205      * @param domainServerName
206      * Name of the server in domain. Use <code>null</code> for
207      * referring to this server.
208      * @param name
209      * ObjectName corresponding to the query string.
210      * @param attribute
211      * The member attribute to be set.
212      * @throws MBeanException
213      * @throws AttributeNotFoundException
214      * @throws InstanceNotFoundException
215      * @throws InvalidAttributeValueException
216      * @throws ReflectionException
217      * @throws RemoteException
218      */

219     void setAttribute(String JavaDoc domainServerName, ObjectName JavaDoc name,
220             Attribute JavaDoc attribute) throws MBeanException JavaDoc,
221             AttributeNotFoundException JavaDoc, InstanceNotFoundException JavaDoc,
222             InvalidAttributeValueException JavaDoc, ReflectionException JavaDoc,
223             RemoteException JavaDoc;
224
225     /**
226      * Sets the values of attributes in <code>attributes</code> inside the
227      * mbean corresponding to the objectname <code>name</code> for the server
228      * with name <code>domainServerName</code>.
229      *
230      * @param domainServerName
231      * Name of the server in domain. Use <code>null</code> for
232      * referring to this server.
233      * @param name
234      * ObjectName corresponding to the MBean.
235      * @param attributes
236      * Array of attribute names to be set.
237      * @return Values of the attributes.
238      * @throws InstanceNotFoundException
239      * @throws ReflectionException
240      * @throws RemoteException
241      */

242     AttributeList JavaDoc setAttributes(String JavaDoc domainServerName, ObjectName JavaDoc name,
243             AttributeList JavaDoc attributes) throws InstanceNotFoundException JavaDoc,
244             ReflectionException JavaDoc, RemoteException JavaDoc;
245
246 }
247
Popular Tags