Path: blob/master/src/java.management/share/classes/javax/management/DynamicMBean.java
41155 views
/*1* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/242526package javax.management;272829/**30* Defines the methods that should be implemented by31* a Dynamic MBean (MBean that exposes a dynamic management interface).32*33* @since 1.534*/35public interface DynamicMBean {363738/**39* Obtain the value of a specific attribute of the Dynamic MBean.40*41* @param attribute The name of the attribute to be retrieved42*43* @return The value of the attribute retrieved.44*45* @exception AttributeNotFoundException if specified attribute does not exist or cannot be retrieved46* @exception MBeanException Wraps a <CODE>java.lang.Exception</CODE> thrown by the MBean's getter.47* @exception ReflectionException Wraps a <CODE>java.lang.Exception</CODE> thrown while trying to invoke the getter.48*49* @see #setAttribute50*/51public Object getAttribute(String attribute) throws AttributeNotFoundException,52MBeanException, ReflectionException;5354/**55* Set the value of a specific attribute of the Dynamic MBean.56*57* @param attribute The identification of the attribute to58* be set and the value it is to be set to.59*60* @exception AttributeNotFoundException if specified attribute does not exist or cannot be retrieved61* @exception InvalidAttributeValueException if value specified is not valid for the attribute62* @exception MBeanException Wraps a <CODE>java.lang.Exception</CODE> thrown by the MBean's setter.63* @exception ReflectionException Wraps a <CODE>java.lang.Exception</CODE> thrown while trying to invoke the MBean's setter.64*65* @see #getAttribute66*/67public void setAttribute(Attribute attribute) throws AttributeNotFoundException,68InvalidAttributeValueException, MBeanException, ReflectionException ;6970/**71* Get the values of several attributes of the Dynamic MBean.72*73* @param attributes A list of the attributes to be retrieved.74*75* @return The list of attributes retrieved.76*77* @see #setAttributes78*/79public AttributeList getAttributes(String[] attributes);8081/**82* Sets the values of several attributes of the Dynamic MBean.83*84* @param attributes A list of attributes: The identification of the85* attributes to be set and the values they are to be set to.86*87* @return The list of attributes that were set, with their new values.88*89* @see #getAttributes90*/91public AttributeList setAttributes(AttributeList attributes);9293/**94* Allows an action to be invoked on the Dynamic MBean.95*96* @param actionName The name of the action to be invoked.97* @param params An array containing the parameters to be set when the action is98* invoked.99* @param signature An array containing the signature of the action. The class objects will100* be loaded through the same class loader as the one used for loading the101* MBean on which the action is invoked.102*103* @return The object returned by the action, which represents the result of104* invoking the action on the MBean specified.105*106* @exception MBeanException Wraps a <CODE>java.lang.Exception</CODE> thrown by the MBean's invoked method.107* @exception ReflectionException Wraps a <CODE>java.lang.Exception</CODE> thrown while trying to invoke the method108*/109public Object invoke(String actionName, Object params[], String signature[])110throws MBeanException, ReflectionException ;111112/**113* Provides the exposed attributes and actions of the Dynamic MBean using an MBeanInfo object.114*115* @return An instance of <CODE>MBeanInfo</CODE> allowing all attributes and actions116* exposed by this Dynamic MBean to be retrieved.117*118*/119public MBeanInfo getMBeanInfo();120121}122123124