001: /**
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 2005 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id$
023: * --------------------------------------------------------------------------
024: */package org.objectweb.jonas.mejb;
025:
026: import java.rmi.RemoteException;
027: import java.util.Set;
028:
029: import javax.management.Attribute;
030: import javax.management.AttributeList;
031: import javax.management.AttributeNotFoundException;
032: import javax.management.InstanceNotFoundException;
033: import javax.management.IntrospectionException;
034: import javax.management.InvalidAttributeValueException;
035: import javax.management.MBeanException;
036: import javax.management.MBeanInfo;
037: import javax.management.ObjectName;
038: import javax.management.QueryExp;
039: import javax.management.ReflectionException;
040: import javax.management.j2ee.Management;
041:
042: /**
043: * This is a variation on the javax.management.j2ee.Management interface
044: * required to be exposed by JOnAS through the MEJB session bean. This extends
045: * the main functionality of the MEJB session bean by allowing clients to query
046: * mbean information from other servers within the same domain.<br/><br/>
047: * Please Note: <code>domainServerName</code> in any of the exposed methods
048: * can be set to one of the values of the array returned by the following call
049: * to a <i> master</i> server:
050: * <code> getAttribute(null, domainObjectName, "serverNames")
051: * </code> where
052: * <code>ObjectName domainObjectName</code> corresponds to the ObjectName:
053: * <i>domainName</i>:j2eeType=J2EEDomain,name=<i>domainName</i>
054: *
055: * @author Vivek Lakshmanan
056: */
057: public interface DomainManagement extends Management {
058:
059: /**
060: * Gets the value of a specified attribute inside the mbean corresponding to
061: * the objectname <code>name</code> for the server with name
062: * <code> domainServerName </code>.
063: *
064: * @param domainServerName
065: * Name of the server in domain. Use <code>null</code> for
066: * referring to this server.
067: * @param name
068: * ObjectName corresponding to the MBean to query.
069: * @param attribute
070: * The member attribute to be queried.
071: * @return Value of the attribute.
072: * @throws MBeanException
073: * @throws AttributeNotFoundException
074: * @throws InstanceNotFoundException
075: * @throws ReflectionException
076: * @throws RemoteException
077: */
078: Object getAttribute(String domainServerName, ObjectName name,
079: String attribute) throws MBeanException,
080: AttributeNotFoundException, InstanceNotFoundException,
081: ReflectionException, RemoteException;
082:
083: /**
084: * Gets the values of attributes in <code>attributes</code> inside the
085: * mbean corresponding to the objectname <code>name</code> for the server
086: * with name <code>domainServerName</code>.
087: *
088: * @param domainServerName
089: * Name of the server in domain. Use <code>null</code> for
090: * referring to this server.
091: * @param name
092: * ObjectName corresponding to the MBean to query.
093: * @param attributes
094: * Array of attribute names to be queried.
095: * @return Value of the attributes.
096: * @throws InstanceNotFoundException
097: * @throws ReflectionException
098: * @throws RemoteException
099: */
100: AttributeList getAttributes(String domainServerName,
101: ObjectName name, String[] attributes)
102: throws InstanceNotFoundException, ReflectionException,
103: RemoteException;
104:
105: /**
106: * The number of MBeans registered in the mbean server corresponding to the
107: * server <code>domainServerName</code> in the domain.
108: *
109: * @param domainServerName
110: * Name of the server in domain. Use <code>null</code> for
111: * referring to this server.
112: * @return Number of MBeans currently registered in server.
113: * @throws MBeanException
114: * @throws AttributeNotFoundException
115: * @throws InstanceNotFoundException
116: * @throws ReflectionException
117: * @throws RemoteException
118: */
119: Integer getMBeanCount(String domainServerName)
120: throws MBeanException, AttributeNotFoundException,
121: InstanceNotFoundException, ReflectionException,
122: RemoteException;
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 getMBeanInfo(String domainServerName, ObjectName name)
140: throws IntrospectionException, InstanceNotFoundException,
141: ReflectionException, RemoteException;
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 invoke(String domainServerName, ObjectName name,
164: String operationName, Object[] params, String[] signature)
165: throws MBeanException, InstanceNotFoundException,
166: ReflectionException, RemoteException;
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 domainServerName, ObjectName name)
181: throws RemoteException;
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 queryNames(String domainServerName, ObjectName name,
198: QueryExp query) throws RemoteException;
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 domainServerName, ObjectName name,
220: Attribute attribute) throws MBeanException,
221: AttributeNotFoundException, InstanceNotFoundException,
222: InvalidAttributeValueException, ReflectionException,
223: RemoteException;
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 setAttributes(String domainServerName,
243: ObjectName name, AttributeList attributes)
244: throws InstanceNotFoundException, ReflectionException,
245: RemoteException;
246:
247: }
|