001: /* JFox, the OpenSource J2EE Application Server
002: *
003: * Copyright (C) 2002 huihoo.org
004: * Distributable under GNU LGPL license
005: * See the GNU Lesser General Public License for more details.
006: */
007:
008: package javax.management;
009:
010: /**
011: * Defines the methods that should be implemented by
012: * a Dynamic MBean (MBean that exposes a dynamic management interface).
013: *
014: * @author <a href="mailto:young_yy@hotmail.org">Young Yang</a>
015: */
016:
017: public interface DynamicMBean {
018:
019: /**
020: * Obtains the value of a specific attribute of the Dynamic MBean.
021: *
022: * @param attribute The name of the attribute to be retrieved
023: *
024: * @return The value of the attribute retrieved.
025: *
026: * @exception AttributeNotFoundException
027: * @exception MBeanException Wraps a <CODE>java.lang.Exception</CODE> thrown by the MBean's getter.
028: * @exception ReflectionException Wraps a <CODE>java.lang.Exception</CODE> thrown while trying to invoke the getter.
029: */
030: public Object getAttribute(String attribute)
031: throws AttributeNotFoundException, MBeanException,
032: ReflectionException;
033:
034: /**
035: * Sets the value of a specific attribute of the Dynamic MBean
036: *
037: * @param attribute The identification of the attribute to
038: * be set and the value it is to be set to.
039: *
040: * @exception AttributeNotFoundException
041: * @exception InvalidAttributeValueException
042: * @exception MBeanException Wraps a <CODE>java.lang.Exception</CODE> thrown by the MBean's setter.
043: * @exception ReflectionException Wraps a <CODE>java.lang.Exception</CODE> thrown while trying to invoke the MBean's setter.
044: */
045: public void setAttribute(Attribute attribute)
046: throws AttributeNotFoundException,
047: InvalidAttributeValueException, MBeanException,
048: ReflectionException;
049:
050: /**
051: * Enables the values of several attributes of the Dynamic MBean.
052: *
053: * @param attributes A list of the attributes to be retrieved.
054: *
055: * @return The list of attributes retrieved.
056: *
057: */
058: public AttributeList getAttributes(String[] attributes);
059:
060: /**
061: * Sets the values of several attributes of the Dynamic MBean
062: *
063: * @param attributes A list of attributes: The identification of the
064: * attributes to be set and the values they are to be set to.
065: *
066: * @return The list of attributes that were set, with their new values.
067: *
068: */
069: public AttributeList setAttributes(AttributeList attributes);
070:
071: /**
072: * Allows an action to be invoked on the Dynamic MBean.
073: *
074: * @param actionName The name of the action to be invoked.
075: * @param params An array containing the parameters to be set when the action is
076: * invoked.
077: * @param signature An array containing the signature of the action. The class objects will
078: * be loaded through the same class loader as the one used for loading the
079: * MBean on which the action is invoked.
080: *
081: * @return The object returned by the action, which represents the result of
082: * invoking the action on the MBean specified.
083: *
084: * @exception MBeanException Wraps a <CODE>java.lang.Exception</CODE> thrown by the MBean's invoked method.
085: * @exception ReflectionException Wraps a <CODE>java.lang.Exception</CODE> thrown while trying to invoke the method
086: */
087: public Object invoke(String actionName, Object params[],
088: String signature[]) throws MBeanException,
089: ReflectionException;
090:
091: /**
092: * Provides the exposed attributes and actions of the Dynamic MBean using an MBeanInfo object.
093: *
094: * @return An instance of <CODE>MBeanInfo</CODE> allowing all attributes and actions
095: * exposed by this Dynamic MBean to be retrieved.
096: *
097: */
098: public MBeanInfo getMBeanInfo();
099:
100: }
|