KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jmx > interceptor > MBeanServerInterceptor


1 /*
2  * @(#)MBeanServerInterceptor.java 1.16 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.jmx.interceptor;
9
10 import java.util.Set JavaDoc;
11
12 // RI import
13
import javax.management.DynamicMBean JavaDoc;
14 import javax.management.AttributeNotFoundException JavaDoc;
15 import javax.management.MBeanException JavaDoc;
16 import javax.management.ReflectionException JavaDoc;
17 import javax.management.MBeanAttributeInfo JavaDoc;
18 import javax.management.MBeanInfo JavaDoc;
19 import javax.management.QueryExp JavaDoc;
20 import javax.management.NotificationListener JavaDoc;
21 import javax.management.NotificationFilter JavaDoc;
22 import javax.management.ListenerNotFoundException JavaDoc;
23 import javax.management.IntrospectionException JavaDoc;
24 import javax.management.OperationsException JavaDoc;
25 import javax.management.MBeanNotificationInfo JavaDoc;
26 import javax.management.JMRuntimeException JavaDoc;
27 import javax.management.InstanceNotFoundException JavaDoc;
28 import javax.management.NotCompliantMBeanException JavaDoc;
29 import javax.management.MBeanRegistrationException JavaDoc;
30 import javax.management.InstanceAlreadyExistsException JavaDoc;
31 import javax.management.InvalidAttributeValueException JavaDoc;
32 import javax.management.ObjectName JavaDoc;
33 import javax.management.ObjectInstance JavaDoc;
34 import javax.management.Attribute JavaDoc;
35 import javax.management.AttributeList JavaDoc;
36 import javax.management.RuntimeOperationsException JavaDoc;
37 import javax.management.MBeanServerConnection JavaDoc;
38 import javax.management.MBeanServerDelegate JavaDoc;
39 import javax.management.loading.ClassLoaderRepository JavaDoc;
40
41 /**
42  * <p>This interface specifies the behavior to be implemented by an
43  * MBean Server Interceptor. An MBean Server Interceptor has
44  * essentially the same interface as an MBean Server. An MBean Server
45  * forwards received requests to its default interceptor, which may
46  * handle them itself or forward them to other interceptors. The
47  * default interceptor may be changed via the {@link
48  * com.sun.jmx.mbeanserver.SunJmxMBeanServer#setMBeanServerInterceptor}
49  * method.</p>
50  *
51  * <p>The initial default interceptor provides the standard MBean
52  * Server behaviour. It handles a collection of named MBeans, each
53  * represented by a Java object. A replacement default interceptor
54  * may build on this behaviour, for instance by adding logging or
55  * security checks, before forwarding requests to the initial default
56  * interceptor. Or, it may route each request to one of a number of
57  * sub-interceptors, for instance based on the {@link ObjectName} in
58  * the request.</p>
59  *
60  * <p>An interceptor, default or not, need not implement MBeans as
61  * Java objects, in the way that the initial default interceptor does.
62  * It may instead implement <em>virtual MBeans</em>, which do not
63  * exist as Java objects when they are not in use. For example, these
64  * MBeans could be implemented by forwarding requests to a database,
65  * or to a remote MBean server, or by performing system calls to query
66  * or modify system resources.</p>
67  *
68  * @since 1.5
69  */

70 public interface MBeanServerInterceptor extends MBeanServerConnection JavaDoc {
71     /**
72      * Instantiates and registers an MBean in the MBean server. The
73      * MBean server will use its {@link
74      * javax.management.loading.ClassLoaderRepository Default Loader
75      * Repository} to load the class of the MBean. An object name is
76      * associated to the MBean. If the object name given is null, the
77      * MBean must provide its own name by implementing the {@link
78      * javax.management.MBeanRegistration MBeanRegistration} interface
79      * and returning the name from the {@link
80      * javax.management.MBeanRegistration#preRegister preRegister} method.
81      *
82      * @param className The class name of the MBean to be instantiated.
83      * @param name The object name of the MBean. May be null.
84      * @param params An array containing the parameters of the
85      * constructor to be invoked.
86      * @param signature An array containing the signature of the
87      * constructor to be invoked.
88      *
89      * @return An <CODE>ObjectInstance</CODE>, containing the
90      * <CODE>ObjectName</CODE> and the Java class name of the newly
91      * instantiated MBean.
92      *
93      * @exception ReflectionException Wraps a
94      * <CODE>java.lang.ClassNotFoundException</CODE> or a
95      * <CODE>java.lang.Exception</CODE> that occurred when trying to
96      * invoke the MBean's constructor.
97      * @exception InstanceAlreadyExistsException The MBean is already
98      * under the control of the MBean server.
99      * @exception MBeanRegistrationException The
100      * <CODE>preRegister</CODE> (<CODE>MBeanRegistration</CODE>
101      * interface) method of the MBean has thrown an exception. The
102      * MBean will not be registered.
103      * @exception MBeanException The constructor of the MBean has
104      * thrown an exception
105      * @exception RuntimeOperationsException Wraps a
106      * <CODE>java.lang.IllegalArgumentException</CODE>: The className
107      * passed in parameter is null, the <CODE>ObjectName</CODE> passed
108      * in parameter contains a pattern or no <CODE>ObjectName</CODE>
109      * is specified for the MBean.
110      */

111     public ObjectInstance JavaDoc createMBean(String JavaDoc className, ObjectName JavaDoc name,
112                       Object JavaDoc params[], String JavaDoc signature[])
113         throws ReflectionException JavaDoc, InstanceAlreadyExistsException JavaDoc,
114                MBeanRegistrationException JavaDoc, MBeanException JavaDoc,
115                NotCompliantMBeanException JavaDoc;
116
117     /**
118      * Instantiates and registers an MBean in the MBean server. The
119      * class loader to be used is identified by its object name. An
120      * object name is associated to the MBean. If the object name of
121      * the loader is not specified, the ClassLoader that loaded the
122      * MBean server will be used. If the MBean object name given is
123      * null, the MBean must provide its own name by implementing the
124      * {@link javax.management.MBeanRegistration MBeanRegistration}
125      * interface and returning the name from the {@link
126      * javax.management.MBeanRegistration#preRegister preRegister} method.
127      *
128      * @param className The class name of the MBean to be instantiated.
129      * @param name The object name of the MBean. May be null.
130      * @param params An array containing the parameters of the
131      * constructor to be invoked.
132      * @param signature An array containing the signature of the
133      * constructor to be invoked.
134      * @param loaderName The object name of the class loader to be used.
135      *
136      * @return An <CODE>ObjectInstance</CODE>, containing the
137      * <CODE>ObjectName</CODE> and the Java class name of the newly
138      * instantiated MBean.
139      *
140      * @exception ReflectionException Wraps a
141      * <CODE>java.lang.ClassNotFoundException</CODE> or a
142      * <CODE>java.lang.Exception</CODE> that occurred when trying to
143      * invoke the MBean's constructor.
144      * @exception InstanceAlreadyExistsException The MBean is already
145      * under the control of the MBean server.
146      * @exception MBeanRegistrationException The
147      * <CODE>preRegister</CODE> (<CODE>MBeanRegistration</CODE>
148      * interface) method of the MBean has thrown an exception. The
149      * MBean will not be registered.
150      * @exception MBeanException The constructor of the MBean has
151      * thrown an exception
152      * @exception InstanceNotFoundException The specified class loader
153      * is not registered in the MBean server.
154      * @exception RuntimeOperationsException Wraps a
155      * <CODE>java.lang.IllegalArgumentException</CODE>: The className
156      * passed in parameter is null, the <CODE>ObjectName</CODE> passed
157      * in parameter contains a pattern or no <CODE>ObjectName</CODE>
158      * is specified for the MBean.
159      *
160      */

161     public ObjectInstance JavaDoc createMBean(String JavaDoc className, ObjectName JavaDoc name,
162                       ObjectName JavaDoc loaderName, Object JavaDoc params[],
163                       String JavaDoc signature[])
164         throws ReflectionException JavaDoc, InstanceAlreadyExistsException JavaDoc,
165                MBeanRegistrationException JavaDoc, MBeanException JavaDoc,
166                NotCompliantMBeanException JavaDoc, InstanceNotFoundException JavaDoc;
167
168     /**
169      * Registers a pre-existing object as an MBean with the MBean
170      * server. If the object name given is null, the MBean must
171      * provide its own name by implementing the {@link
172      * javax.management.MBeanRegistration MBeanRegistration} interface
173      * and returning the name from the {@link
174      * javax.management.MBeanRegistration#preRegister preRegister} method.
175      *
176      * @param object The MBean to be registered as an MBean.
177      * @param name The object name of the MBean. May be null.
178      *
179      * @return The <CODE>ObjectInstance</CODE> for the MBean that has
180      * been registered.
181      *
182      * @exception InstanceAlreadyExistsException The MBean is already
183      * under the control of the MBean server.
184      * @exception MBeanRegistrationException The
185      * <CODE>preRegister</CODE> (<CODE>MBeanRegistration</CODE>
186      * interface) method of the MBean has thrown an exception. The
187      * MBean will not be registered.
188      * @exception NotCompliantMBeanException This object is not a JMX
189      * compliant MBean
190      * @exception RuntimeOperationsException Wraps a
191      * <CODE>java.lang.IllegalArgumentException</CODE>: The object
192      * passed in parameter is null or no object name is specified.
193      */

194     public ObjectInstance JavaDoc registerMBean(Object JavaDoc object, ObjectName JavaDoc name)
195         throws InstanceAlreadyExistsException JavaDoc, MBeanRegistrationException JavaDoc,
196            NotCompliantMBeanException JavaDoc;
197
198     /**
199      * Unregisters an MBean from the MBean server. The MBean is
200      * identified by its object name. Once the method has been
201      * invoked, the MBean may no longer be accessed by its object
202      * name.
203      *
204      * @param name The object name of the MBean to be unregistered.
205      *
206      * @exception InstanceNotFoundException The MBean specified is not
207      * registered in the MBean server.
208      * @exception MBeanRegistrationException The preDeregister
209      * ((<CODE>MBeanRegistration</CODE> interface) method of the MBean
210      * has thrown an exception.
211      * @exception RuntimeOperationsException Wraps a
212      * <CODE>java.lang.IllegalArgumentException</CODE>: The object
213      * name in parameter is null or the MBean you are when trying to
214      * unregister is the {@link javax.management.MBeanServerDelegate
215      * MBeanServerDelegate} MBean.
216      *
217      */

218     public void unregisterMBean(ObjectName JavaDoc name)
219         throws InstanceNotFoundException JavaDoc, MBeanRegistrationException JavaDoc;
220
221     /**
222      * Gets the <CODE>ObjectInstance</CODE> for a given MBean
223      * registered with the MBean server.
224      *
225      * @param name The object name of the MBean.
226      *
227      * @return The <CODE>ObjectInstance</CODE> associated to the MBean
228      * specified by <VAR>name</VAR>.
229      *
230      * @exception InstanceNotFoundException The MBean specified is not
231      * registered in the MBean server.
232      */

233     public ObjectInstance JavaDoc getObjectInstance(ObjectName JavaDoc name)
234         throws InstanceNotFoundException JavaDoc;
235
236     /**
237      * Gets MBeans controlled by the MBean server. This method allows
238      * any of the following to be obtained: All MBeans, a set of
239      * MBeans specified by pattern matching on the
240      * <CODE>ObjectName</CODE> and/or a Query expression, a specific
241      * MBean. When the object name is null or no domain and key
242      * properties are specified, all objects are to be selected (and
243      * filtered if a query is specified). It returns the set of
244      * <CODE>ObjectInstance</CODE> objects (containing the
245      * <CODE>ObjectName</CODE> and the Java Class name) for the
246      * selected MBeans.
247      *
248      * @param name The object name pattern identifying the MBeans to
249      * be retrieved. If null or no domain and key properties are
250      * specified, all the MBeans registered will be retrieved.
251      * @param query The query expression to be applied for selecting
252      * MBeans. If null no query expression will be applied for
253      * selecting MBeans.
254      *
255      * @return A set containing the <CODE>ObjectInstance</CODE>
256      * objects for the selected MBeans. If no MBean satisfies the
257      * query an empty list is returned.
258      */

259     public Set JavaDoc queryMBeans(ObjectName JavaDoc name, QueryExp JavaDoc query);
260
261     /**
262      * Gets the names of MBeans controlled by the MBean server. This
263      * method enables any of the following to be obtained: The names
264      * of all MBeans, the names of a set of MBeans specified by
265      * pattern matching on the <CODE>ObjectName</CODE> and/or a Query
266      * expression, a specific MBean name (equivalent to testing
267      * whether an MBean is registered). When the object name is null
268      * or no domain and key properties are specified, all objects are
269      * selected (and filtered if a query is specified). It returns the
270      * set of ObjectNames for the MBeans selected.
271      *
272      * @param name The object name pattern identifying the MBean names
273      * to be retrieved. If null oror no domain and key properties are
274      * specified, the name of all registered MBeans will be retrieved.
275      * @param query The query expression to be applied for selecting
276      * MBeans. If null no query expression will be applied for
277      * selecting MBeans.
278      *
279      * @return A set containing the ObjectNames for the MBeans
280      * selected. If no MBean satisfies the query, an empty list is
281      * returned.
282      */

283     public Set JavaDoc queryNames(ObjectName JavaDoc name, QueryExp JavaDoc query);
284
285     /**
286      * Checks whether an MBean, identified by its object name, is
287      * already registered with the MBean server.
288      *
289      * @param name The object name of the MBean to be checked.
290      *
291      * @return True if the MBean is already registered in the MBean
292      * server, false otherwise.
293      *
294      * @exception RuntimeOperationsException Wraps a
295      * <CODE>java.lang.IllegalArgumentException</CODE>: The object
296      * name in parameter is null.
297      */

298     public boolean isRegistered(ObjectName JavaDoc name);
299
300     /**
301      * Returns the number of MBeans registered in the MBean server.
302      */

303     public Integer JavaDoc getMBeanCount();
304
305     /**
306      * Gets the value of a specific attribute of a named MBean. The MBean
307      * is identified by its object name.
308      *
309      * @param name The object name of the MBean from which the
310      * attribute is to be retrieved.
311      * @param attribute A String specifying the name of the attribute
312      * to be retrieved.
313      *
314      * @return The value of the retrieved attribute.
315      *
316      * @exception AttributeNotFoundException The attribute specified
317      * is not accessible in the MBean.
318      * @exception MBeanException Wraps an exception thrown by the
319      * MBean's getter.
320      * @exception InstanceNotFoundException The MBean specified is not
321      * registered in the MBean server.
322      * @exception ReflectionException Wraps a
323      * <CODE>java.lang.Exception</CODE> thrown when trying to invoke
324      * the setter.
325      * @exception RuntimeOperationsException Wraps a
326      * <CODE>java.lang.IllegalArgumentException</CODE>: The object
327      * name in parameter is null or the attribute in parameter is
328      * null.
329      */

330     public Object JavaDoc getAttribute(ObjectName JavaDoc name, String JavaDoc attribute)
331         throws MBeanException JavaDoc, AttributeNotFoundException JavaDoc,
332                InstanceNotFoundException JavaDoc, ReflectionException JavaDoc;
333
334     /**
335      * Enables the values of several attributes of a named MBean. The MBean
336      * is identified by its object name.
337      *
338      * @param name The object name of the MBean from which the
339      * attributes are retrieved.
340      * @param attributes A list of the attributes to be retrieved.
341      *
342      * @return The list of the retrieved attributes.
343      *
344      * @exception InstanceNotFoundException The MBean specified is not
345      * registered in the MBean server.
346      * @exception ReflectionException An exception occurred when
347      * trying to invoke the getAttributes method of a Dynamic MBean.
348      * @exception RuntimeOperationsException Wrap a
349      * <CODE>java.lang.IllegalArgumentException</CODE>: The object
350      * name in parameter is null or attributes in parameter is null.
351      */

352     public AttributeList JavaDoc getAttributes(ObjectName JavaDoc name, String JavaDoc[] attributes)
353         throws InstanceNotFoundException JavaDoc, ReflectionException JavaDoc;
354
355     /**
356      * Sets the value of a specific attribute of a named MBean. The MBean
357      * is identified by its object name.
358      *
359      * @param name The name of the MBean within which the attribute is
360      * to be set.
361      * @param attribute The identification of the attribute to be set
362      * and the value it is to be set to.
363      *
364      * @return The value of the attribute that has been set.
365      *
366      * @exception InstanceNotFoundException The MBean specified is not
367      * registered in the MBean server.
368      * @exception AttributeNotFoundException The attribute specified
369      * is not accessible in the MBean.
370      * @exception InvalidAttributeValueException The value specified
371      * for the attribute is not valid.
372      * @exception MBeanException Wraps an exception thrown by the
373      * MBean's setter.
374      * @exception ReflectionException Wraps a
375      * <CODE>java.lang.Exception</CODE> thrown when trying to invoke
376      * the setter.
377      * @exception RuntimeOperationsException Wraps a
378      * <CODE>java.lang.IllegalArgumentException</CODE>: The object
379      * name in parameter is null or the attribute in parameter is
380      * null.
381      */

382     public void setAttribute(ObjectName JavaDoc name, Attribute JavaDoc attribute)
383         throws InstanceNotFoundException JavaDoc, AttributeNotFoundException JavaDoc,
384            InvalidAttributeValueException JavaDoc, MBeanException JavaDoc,
385            ReflectionException JavaDoc;
386
387
388
389     /**
390      * Sets the values of several attributes of a named MBean. The MBean is
391      * identified by its object name.
392      *
393      * @param name The object name of the MBean within which the
394      * attributes are to be set.
395      * @param attributes A list of attributes: The identification of
396      * the attributes to be set and the values they are to be set to.
397      *
398      * @return The list of attributes that were set, with their new
399      * values.
400      *
401      * @exception InstanceNotFoundException The MBean specified is not
402      * registered in the MBean server.
403      * @exception ReflectionException An exception occurred when
404      * trying to invoke the getAttributes method of a Dynamic MBean.
405      * @exception RuntimeOperationsException Wraps a
406      * <CODE>java.lang.IllegalArgumentException</CODE>: The object
407      * name in parameter is null or attributes in parameter is null.
408      */

409     public AttributeList JavaDoc setAttributes(ObjectName JavaDoc name,
410                        AttributeList JavaDoc attributes)
411     throws InstanceNotFoundException JavaDoc, ReflectionException JavaDoc;
412
413     /**
414      * Invokes an operation on an MBean.
415      *
416      * @param name The object name of the MBean on which the method is
417      * to be invoked.
418      * @param operationName The name of the operation to be invoked.
419      * @param params An array containing the parameters to be set when
420      * the operation is invoked
421      * @param signature An array containing the signature of the
422      * operation. The class objects will be loaded using the same
423      * class loader as the one used for loading the MBean on which the
424      * operation was invoked.
425      *
426      * @return The object returned by the operation, which represents
427      * the result ofinvoking the operation on the MBean specified.
428      *
429      * @exception InstanceNotFoundException The MBean specified is not
430      * registered in the MBean server.
431      * @exception MBeanException Wraps an exception thrown by the
432      * MBean's invoked method.
433      * @exception ReflectionException Wraps a
434      * <CODE>java.lang.Exception</CODE> thrown while trying to invoke
435      * the method.
436      */

437     public Object JavaDoc invoke(ObjectName JavaDoc name, String JavaDoc operationName,
438              Object JavaDoc params[], String JavaDoc signature[])
439         throws InstanceNotFoundException JavaDoc, MBeanException JavaDoc,
440            ReflectionException JavaDoc;
441  
442     /**
443      * Returns the default domain used for naming the MBean.
444      * The default domain name is used as the domain part in the ObjectName
445      * of MBeans if no domain is specified by the user.
446      */

447     public String JavaDoc getDefaultDomain();
448
449     /**
450      * Returns the list of domains in which any MBean is currently
451      * registered.
452      */

453     public String JavaDoc[] getDomains();
454
455     /**
456      * <p>Adds a listener to a registered MBean.</p>
457      *
458      * <P> A notification emitted by an MBean will be forwarded by the
459      * MBeanServer to the listener. If the source of the notification
460      * is a reference to an MBean object, the MBean server will replace it
461      * by that MBean's ObjectName. Otherwise the source is unchanged.
462      *
463      * @param name The name of the MBean on which the listener should
464      * be added.
465      * @param listener The listener object which will handle the
466      * notifications emitted by the registered MBean.
467      * @param filter The filter object. If filter is null, no
468      * filtering will be performed before handling notifications.
469      * @param handback The context to be sent to the listener when a
470      * notification is emitted.
471      *
472      * @exception InstanceNotFoundException The MBean name provided
473      * does not match any of the registered MBeans.
474      */

475     public void addNotificationListener(ObjectName JavaDoc name,
476                     NotificationListener JavaDoc listener,
477                     NotificationFilter JavaDoc filter,
478                     Object JavaDoc handback)
479         throws InstanceNotFoundException JavaDoc;
480
481
482     /**
483      * <p>Adds a listener to a registered MBean.</p>
484      *
485      * <p>A notification emitted by an MBean will be forwarded by the
486      * MBeanServer to the listener. If the source of the notification
487      * is a reference to an MBean object, the MBean server will
488      * replace it by that MBean's ObjectName. Otherwise the source is
489      * unchanged.</p>
490      *
491      * <p>The listener object that receives notifications is the one
492      * that is registered with the given name at the time this method
493      * is called. Even if it is subsequently unregistered, it will
494      * continue to receive notifications.</p>
495      *
496      * @param name The name of the MBean on which the listener should
497      * be added.
498      * @param listener The object name of the listener which will
499      * handle the notifications emitted by the registered MBean.
500      * @param filter The filter object. If filter is null, no
501      * filtering will be performed before handling notifications.
502      * @param handback The context to be sent to the listener when a
503      * notification is emitted.
504      *
505      * @exception InstanceNotFoundException The MBean name of the
506      * notification listener or of the notification broadcaster does
507      * not match any of the registered MBeans.
508      * @exception RuntimeOperationsException Wraps an {@link
509      * IllegalArgumentException}. The MBean named by
510      * <code>listener</code> exists but does not implement the {@link
511      * NotificationListener} interface.
512      * @exception IOException A communication problem occurred when
513      * talking to the MBean server.
514      */

515     public void addNotificationListener(ObjectName JavaDoc name,
516                     ObjectName JavaDoc listener,
517                     NotificationFilter JavaDoc filter,
518                     Object JavaDoc handback)
519         throws InstanceNotFoundException JavaDoc;
520
521     /**
522      * Removes a listener from a registered MBean.
523      *
524      * <P> If the listener is registered more than once, perhaps with
525      * different filters or callbacks, this method will remove all
526      * those registrations.
527      *
528      * @param name The name of the MBean on which the listener should
529      * be removed.
530      * @param listener The object name of the listener to be removed.
531      *
532      * @exception InstanceNotFoundException The MBean name provided
533      * does not match any of the registered MBeans.
534      * @exception ListenerNotFoundException The listener is not
535      * registered in the MBean.
536      */

537     public void removeNotificationListener(ObjectName JavaDoc name,
538                        ObjectName JavaDoc listener)
539     throws InstanceNotFoundException JavaDoc, ListenerNotFoundException JavaDoc;
540
541     /**
542      * <p>Removes a listener from a registered MBean.</p>
543      *
544      * <p>The MBean must have a listener that exactly matches the
545      * given <code>listener</code>, <code>filter</code>, and
546      * <code>handback</code> parameters. If there is more than one
547      * such listener, only one is removed.</p>
548      *
549      * <p>The <code>filter</code> and <code>handback</code> parameters
550      * may be null if and only if they are null in a listener to be
551      * removed.</p>
552      *
553      * @param name The name of the MBean on which the listener should
554      * be removed.
555      * @param listener A listener that was previously added to this
556      * MBean.
557      * @param filter The filter that was specified when the listener
558      * was added.
559      * @param handback The handback that was specified when the
560      * listener was added.
561      *
562      * @exception InstanceNotFoundException The MBean name provided
563      * does not match any of the registered MBeans.
564      * @exception ListenerNotFoundException The listener is not
565      * registered in the MBean, or it is not registered with the given
566      * filter and handback.
567      */

568     public void removeNotificationListener(ObjectName JavaDoc name,
569                        ObjectName JavaDoc listener,
570                        NotificationFilter JavaDoc filter,
571                        Object JavaDoc handback)
572         throws InstanceNotFoundException JavaDoc, ListenerNotFoundException JavaDoc;
573
574
575     /**
576      * <p>Removes a listener from a registered MBean.</p>
577      *
578      * <P> If the listener is registered more than once, perhaps with
579      * different filters or callbacks, this method will remove all
580      * those registrations.
581      *
582      * @param name The name of the MBean on which the listener should
583      * be removed.
584      * @param listener The listener object which will handle the
585      * notifications emitted by the registered MBean.
586      *
587      * @exception InstanceNotFoundException The MBean name provided
588      * does not match any of the registered MBeans.
589      * @exception ListenerNotFoundException The listener is not
590      * registered in the MBean.
591      */

592     public void removeNotificationListener(ObjectName JavaDoc name,
593                        NotificationListener JavaDoc listener)
594         throws InstanceNotFoundException JavaDoc, ListenerNotFoundException JavaDoc;
595
596     /**
597      * <p>Removes a listener from a registered MBean.</p>
598      *
599      * <p>The MBean must have a listener that exactly matches the
600      * given <code>listener</code>, <code>filter</code>, and
601      * <code>handback</code> parameters. If there is more than one
602      * such listener, only one is removed.</p>
603      *
604      * <p>The <code>filter</code> and <code>handback</code> parameters
605      * may be null if and only if they are null in a listener to be
606      * removed.</p>
607      *
608      * @param name The name of the MBean on which the listener should
609      * be removed.
610      * @param listener A listener that was previously added to this
611      * MBean.
612      * @param filter The filter that was specified when the listener
613      * was added.
614      * @param handback The handback that was specified when the
615      * listener was added.
616      *
617      * @exception InstanceNotFoundException The MBean name provided
618      * does not match any of the registered MBeans.
619      * @exception ListenerNotFoundException The listener is not
620      * registered in the MBean, or it is not registered with the given
621      * filter and handback.
622      */

623     public void removeNotificationListener(ObjectName JavaDoc name,
624                        NotificationListener JavaDoc listener,
625                        NotificationFilter JavaDoc filter,
626                        Object JavaDoc handback)
627         throws InstanceNotFoundException JavaDoc, ListenerNotFoundException JavaDoc;
628
629     /**
630      * This method discovers the attributes and operations that an
631      * MBean exposes for management.
632      *
633      * @param name The name of the MBean to analyze
634      *
635      * @return An instance of <CODE>MBeanInfo</CODE> allowing the
636      * retrieval of all attributes and operations of this MBean.
637      *
638      * @exception IntrospectionException An exception occured during
639      * introspection.
640      * @exception InstanceNotFoundException The MBean specified was
641      * not found.
642      * @exception ReflectionException An exception occurred when
643      * trying to invoke the getMBeanInfo of a Dynamic MBean.
644      */

645     public MBeanInfo JavaDoc getMBeanInfo(ObjectName JavaDoc name)
646         throws InstanceNotFoundException JavaDoc, IntrospectionException JavaDoc,
647                ReflectionException JavaDoc;
648
649  
650     /**
651      * Returns true if the MBean specified is an instance of the
652      * specified class, false otherwise.
653      *
654      * @param name The <CODE>ObjectName</CODE> of the MBean.
655      * @param className The name of the class.
656      *
657      * @return true if the MBean specified is an instance of the
658      * specified class, false otherwise.
659      *
660      * @exception InstanceNotFoundException The MBean specified is not
661      * registered in the MBean server.
662      */

663     public boolean isInstanceOf(ObjectName JavaDoc name, String JavaDoc className)
664         throws InstanceNotFoundException JavaDoc;
665  
666     /**
667      * <p>Return the {@link java.lang.ClassLoader} that was used for
668      * loading the class of the named MBean.
669      * @param mbeanName The ObjectName of the MBean.
670      * @return The ClassLoader used for that MBean.
671      * @exception InstanceNotFoundException if the named MBean is not found.
672      */

673     public ClassLoader JavaDoc getClassLoaderFor(ObjectName JavaDoc mbeanName)
674     throws InstanceNotFoundException JavaDoc;
675
676     /**
677      * <p>Return the named {@link java.lang.ClassLoader}.
678      * @param loaderName The ObjectName of the ClassLoader.
679      * @return The named ClassLoader.
680      * @exception InstanceNotFoundException if the named ClassLoader is
681      * not found.
682      */

683     public ClassLoader JavaDoc getClassLoader(ObjectName JavaDoc loaderName)
684     throws InstanceNotFoundException JavaDoc;
685
686 }
687
Popular Tags