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. package javax.management;
  8. /**
  9. * Defines the methods that should be implemented by
  10. * a Dynamic MBean (MBean that exposes a dynamic management interface).
  11. *
  12. * @since 1.5
  13. */
  14. public interface DynamicMBean {
  15. /**
  16. * Obtain the value of a specific attribute of the Dynamic MBean.
  17. *
  18. * @param attribute The name of the attribute to be retrieved
  19. *
  20. * @return The value of the attribute retrieved.
  21. *
  22. * @exception AttributeNotFoundException
  23. * @exception MBeanException Wraps a <CODE>java.lang.Exception</CODE> thrown by the MBean's getter.
  24. * @exception ReflectionException Wraps a <CODE>java.lang.Exception</CODE> thrown while trying to invoke the getter.
  25. *
  26. * @see #setAttribute
  27. */
  28. public Object getAttribute(String attribute) throws AttributeNotFoundException,
  29. MBeanException, ReflectionException;
  30. /**
  31. * Set the value of a specific attribute of the Dynamic MBean.
  32. *
  33. * @param attribute The identification of the attribute to
  34. * be set and the value it is to be set to.
  35. *
  36. * @exception AttributeNotFoundException
  37. * @exception InvalidAttributeValueException
  38. * @exception MBeanException Wraps a <CODE>java.lang.Exception</CODE> thrown by the MBean's setter.
  39. * @exception ReflectionException Wraps a <CODE>java.lang.Exception</CODE> thrown while trying to invoke the MBean's setter.
  40. *
  41. * @see #getAttribute
  42. */
  43. public void setAttribute(Attribute attribute) throws AttributeNotFoundException,
  44. InvalidAttributeValueException, MBeanException, ReflectionException ;
  45. /**
  46. * Get the values of several attributes of the Dynamic MBean.
  47. *
  48. * @param attributes A list of the attributes to be retrieved.
  49. *
  50. * @return The list of attributes retrieved.
  51. *
  52. * @see #setAttributes
  53. */
  54. public AttributeList getAttributes(String[] attributes);
  55. /**
  56. * Sets the values of several attributes of the Dynamic MBean.
  57. *
  58. * @param attributes A list of attributes: The identification of the
  59. * attributes to be set and the values they are to be set to.
  60. *
  61. * @return The list of attributes that were set, with their new values.
  62. *
  63. * @see #getAttributes
  64. */
  65. public AttributeList setAttributes(AttributeList attributes);
  66. /**
  67. * Allows an action to be invoked on the Dynamic MBean.
  68. *
  69. * @param actionName The name of the action to be invoked.
  70. * @param params An array containing the parameters to be set when the action is
  71. * invoked.
  72. * @param signature An array containing the signature of the action. The class objects will
  73. * be loaded through the same class loader as the one used for loading the
  74. * MBean on which the action is invoked.
  75. *
  76. * @return The object returned by the action, which represents the result of
  77. * invoking the action on the MBean specified.
  78. *
  79. * @exception MBeanException Wraps a <CODE>java.lang.Exception</CODE> thrown by the MBean's invoked method.
  80. * @exception ReflectionException Wraps a <CODE>java.lang.Exception</CODE> thrown while trying to invoke the method
  81. */
  82. public Object invoke(String actionName, Object params[], String signature[])
  83. throws MBeanException, ReflectionException ;
  84. /**
  85. * Provides the exposed attributes and actions of the Dynamic MBean using an MBeanInfo object.
  86. *
  87. * @return An instance of <CODE>MBeanInfo</CODE> allowing all attributes and actions
  88. * exposed by this Dynamic MBean to be retrieved.
  89. *
  90. */
  91. public MBeanInfo getMBeanInfo();
  92. }