KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > management > DynamicMBean


1 /*
2  * @(#)DynamicMBean.java 4.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
9 package javax.management;
10
11
12 /**
13  * Defines the methods that should be implemented by
14  * a Dynamic MBean (MBean that exposes a dynamic management interface).
15  *
16  * @since 1.5
17  */

18 public interface DynamicMBean {
19
20
21     /**
22      * Obtain the value of a specific attribute of the Dynamic MBean.
23      *
24      * @param attribute The name of the attribute to be retrieved
25      *
26      * @return The value of the attribute retrieved.
27      *
28      * @exception AttributeNotFoundException
29      * @exception MBeanException Wraps a <CODE>java.lang.Exception</CODE> thrown by the MBean's getter.
30      * @exception ReflectionException Wraps a <CODE>java.lang.Exception</CODE> thrown while trying to invoke the getter.
31      *
32      * @see #setAttribute
33      */

34     public Object JavaDoc getAttribute(String JavaDoc attribute) throws AttributeNotFoundException JavaDoc,
35     MBeanException JavaDoc, ReflectionException JavaDoc;
36     
37     /**
38      * Set the value of a specific attribute of the Dynamic MBean.
39      *
40      * @param attribute The identification of the attribute to
41      * be set and the value it is to be set to.
42      *
43      * @exception AttributeNotFoundException
44      * @exception InvalidAttributeValueException
45      * @exception MBeanException Wraps a <CODE>java.lang.Exception</CODE> thrown by the MBean's setter.
46      * @exception ReflectionException Wraps a <CODE>java.lang.Exception</CODE> thrown while trying to invoke the MBean's setter.
47      *
48      * @see #getAttribute
49      */

50     public void setAttribute(Attribute JavaDoc attribute) throws AttributeNotFoundException JavaDoc,
51     InvalidAttributeValueException JavaDoc, MBeanException JavaDoc, ReflectionException JavaDoc ;
52         
53     /**
54      * Get the values of several attributes of the Dynamic MBean.
55      *
56      * @param attributes A list of the attributes to be retrieved.
57      *
58      * @return The list of attributes retrieved.
59      *
60      * @see #setAttributes
61      */

62     public AttributeList JavaDoc getAttributes(String JavaDoc[] attributes);
63         
64     /**
65      * Sets the values of several attributes of the Dynamic MBean.
66      *
67      * @param attributes A list of attributes: The identification of the
68      * attributes to be set and the values they are to be set to.
69      *
70      * @return The list of attributes that were set, with their new values.
71      *
72      * @see #getAttributes
73      */

74     public AttributeList JavaDoc setAttributes(AttributeList JavaDoc attributes);
75     
76     /**
77      * Allows an action to be invoked on the Dynamic MBean.
78      *
79      * @param actionName The name of the action to be invoked.
80      * @param params An array containing the parameters to be set when the action is
81      * invoked.
82      * @param signature An array containing the signature of the action. The class objects will
83      * be loaded through the same class loader as the one used for loading the
84      * MBean on which the action is invoked.
85      *
86      * @return The object returned by the action, which represents the result of
87      * invoking the action on the MBean specified.
88      *
89      * @exception MBeanException Wraps a <CODE>java.lang.Exception</CODE> thrown by the MBean's invoked method.
90      * @exception ReflectionException Wraps a <CODE>java.lang.Exception</CODE> thrown while trying to invoke the method
91      */

92     public Object JavaDoc invoke(String JavaDoc actionName, Object JavaDoc params[], String JavaDoc signature[])
93     throws MBeanException JavaDoc, ReflectionException JavaDoc ;
94     
95     /**
96      * Provides the exposed attributes and actions of the Dynamic MBean using an MBeanInfo object.
97      *
98      * @return An instance of <CODE>MBeanInfo</CODE> allowing all attributes and actions
99      * exposed by this Dynamic MBean to be retrieved.
100      *
101      */

102     public MBeanInfo JavaDoc getMBeanInfo();
103     
104  }
105
Popular Tags