KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > jmx > RMIConnector


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 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: RMIConnector.java,v 1.5 2004/04/27 14:44:21 danesa Exp $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.jonas.jmx;
26
27 import java.rmi.Remote JavaDoc;
28 import java.rmi.RemoteException JavaDoc;
29 import javax.management.*;
30
31 /**
32  * Interface for JMX Remote Calls. Only methods used by the management applications are listed here,
33  * but potentially we could list all operations from JMXServer.
34  *
35  * @author Michel Bruno and Guillaume Riviere
36  */

37 public interface RMIConnector extends Remote JavaDoc {
38
39     /**
40      * Gets the names of MBeans controlled by the MBean server.
41      * @param name - The object name pattern identifying the MBeans to be retrieved.
42      * @param query - The query expression to be applied for selecting MBeans.
43      * @return A set containing the ObjectNames for the MBeans selected.
44      * If no MBean satisfies the query, an empty list is returned.
45      */

46     public java.util.Set JavaDoc queryNames(ObjectName name,
47                     QueryExp query)
48     throws RemoteException JavaDoc;
49
50     /**
51      * Checks whether an MBean, identified by its object name, is
52      * already registered with the MBean server.
53      * @param name - The object name pattern identifying the MBeans
54      */

55     public boolean isRegistered(ObjectName name)
56     throws RemoteException JavaDoc;
57
58     /**
59      * Gets the value of a specific attribute of a named MBean.
60      * @param name - The name of the MBean
61      * @param attribute - the name of the attribute to be retrieved.
62      * @return The value of the retrieved attribute.
63      */

64     public java.lang.Object JavaDoc getAttribute(ObjectName name,
65                      String JavaDoc attribute)
66     throws MBeanException,
67            AttributeNotFoundException,
68            InstanceNotFoundException,
69            ReflectionException,
70            RemoteException JavaDoc;
71
72     public AttributeList getAttributes(ObjectName name,
73                                        String JavaDoc[] attributes)
74         throws InstanceNotFoundException,
75                ReflectionException,
76                RemoteException JavaDoc;
77
78     /**
79      * Sets the value of a specific attribute of a named MBean.
80      * @param name - The name of the MBean
81      */

82     public void setAttribute(ObjectName name,
83                  Attribute attribute)
84     throws InstanceNotFoundException,
85            AttributeNotFoundException,
86            InvalidAttributeValueException,
87            MBeanException,
88            ReflectionException,
89            RemoteException JavaDoc;
90
91     public AttributeList setAttributes(ObjectName name,
92                                        AttributeList attributes)
93         throws InstanceNotFoundException,
94                ReflectionException,
95                RemoteException JavaDoc;
96
97     /**
98      * Invokes an operation on an MBean.
99      * @param name - The name of the MBean
100      * @param operationName - The name of the operation to be invoked.
101      * @param params - An array containing the parameters to be set when the operation is invoked
102      * @param signature - An array containing the signature of the operation.
103      * The class objects will be loaded using the same class loader as the one
104      * used for loading the MBean on which the operation was invoked.
105      * @return The object returned by the operation
106      */

107     public Object JavaDoc invoke(ObjectName name,
108              String JavaDoc operationName,
109              Object JavaDoc[] params,
110              String JavaDoc[] signature)
111     throws InstanceNotFoundException,
112            MBeanException,
113            ReflectionException,
114            RemoteException JavaDoc;
115
116     /**
117      * This method discovers the attributes and operations that an MBean
118      * exposes for management.
119      * @param name - The name of the MBean to analyze
120      * @return An instance of MBeanInfo allowing the retrieval of all
121      * attributes and operations of this MBean.
122      */

123     public MBeanInfo getMBeanInfo(ObjectName name)
124     throws InstanceNotFoundException,
125            IntrospectionException,
126            ReflectionException,
127            RemoteException JavaDoc;
128
129     /**
130      * Adds a listener to a registered MBean.
131      * @param name - The name of the MBean on which the listener should be added.
132      * @param listener - The listener object which will handle the notifications emitted by the registered MBean.
133      * @param listener - The listener object which will handle the notifications emitted by the registered MBean.
134      * @param filter - The filter object. If filter is null, no filtering will be performed before handling notifications.
135      * @param handback - The context to be sent to the listener when a notification is emitted.
136      */

137     public void addNotificationListener(ObjectName name,
138                                     NotificationListener listener,
139                                     NotificationFilter filter,
140                                     Object JavaDoc handback)
141         throws InstanceNotFoundException,
142                RemoteException JavaDoc;
143
144     /**
145      * Adds a listener to a registered MBean.
146      * @param name - The name of the MBean on which the listener should be added.
147      * @param listener - The object name of the listener which will handle the notifications emitted by the registered MBean.
148      * @param listener - The listener object which will handle the notifications emitted by the registered MBean.
149      * @param filter - The filter object. If filter is null, no filtering will be performed before handling notifications.
150      * @param handback - The context to be sent to the listener when a notification is emitted.
151      */

152     public void addNotificationListener(ObjectName name,
153                                     ObjectName listener,
154                                     NotificationFilter filter,
155                                     Object JavaDoc handback)
156         throws InstanceNotFoundException,
157                RemoteException JavaDoc;
158 }
159
Popular Tags