OpenMBeanInfo.java 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. /* OpenMBeanInfo.java -- Open typed info about a management bean.
  2. Copyright (C) 2006 Free Software Foundation, Inc.
  3. This file is part of GNU Classpath.
  4. GNU Classpath is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2, or (at your option)
  7. any later version.
  8. GNU Classpath is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GNU Classpath; see the file COPYING. If not, write to the
  14. Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  15. 02110-1301 USA.
  16. Linking this library statically or dynamically with other modules is
  17. making a combined work based on this library. Thus, the terms and
  18. conditions of the GNU General Public License cover the whole
  19. combination.
  20. As a special exception, the copyright holders of this library give you
  21. permission to link this library with independent modules to produce an
  22. executable, regardless of the license terms of these independent
  23. modules, and to copy and distribute the resulting executable under
  24. terms of your choice, provided that you also meet, for each linked
  25. independent module, the terms and conditions of the license of that
  26. module. An independent module is a module which is not derived from
  27. or based on this library. If you modify this library, you may extend
  28. this exception to your version of the library, but you are not
  29. obligated to do so. If you do not wish to do so, delete this
  30. exception statement from your version. */
  31. package javax.management.openmbean;
  32. import javax.management.MBeanAttributeInfo;
  33. import javax.management.MBeanConstructorInfo;
  34. import javax.management.MBeanNotificationInfo;
  35. import javax.management.MBeanOperationInfo;
  36. /**
  37. * Describes an open management bean. Open management beans are
  38. * management beans where {@link
  39. * javax.management.DynamicMBean#getMBeanInfo()} returns an
  40. * implementation of this interface. This interface includes those
  41. * methods specified by {@link javax.management.MBeanInfo},
  42. * so implementations should extend this class. Each method
  43. * which returns an array of one of the <code>MBeanXXXInfo</code>
  44. * classes should return an array containing instances
  45. * of the equivalent open version (<code>OpenMBeanXXXInfo</code>).
  46. *
  47. * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
  48. * @since 1.5
  49. */
  50. public interface OpenMBeanInfo
  51. {
  52. /**
  53. * Compares this attribute with the supplied object. This returns
  54. * true iff the object is an instance of {@link OpenMBeanInfo}
  55. * with the same class name and equal instances of the info classes.
  56. *
  57. * @param obj the object to compare.
  58. * @return true if the object is a {@link OpenMBeanInfo}
  59. * instance,
  60. * <code>className.equals(object.getClassName())</code>
  61. * and each info class has an equal in the other object.
  62. */
  63. boolean equals(Object obj);
  64. /**
  65. * Returns descriptions of each of the attributes provided by this
  66. * management bean. The elements should be implementations of the
  67. * {@link OpenMBeanAttributeInfo} class.
  68. *
  69. * @return an array of {@link OpenMBeanAttributeInfo} objects,
  70. * representing the attributes emitted by this
  71. * management bean.
  72. */
  73. MBeanAttributeInfo[] getAttributes();
  74. /**
  75. * Returns the class name of the management bean.
  76. *
  77. * @return the bean's class name.
  78. */
  79. String getClassName();
  80. /**
  81. * Returns descriptions of each of the constructors provided by this
  82. * management bean. The elements should be implementations of the
  83. * {@link OpenMBeanConstructorInfo} class.
  84. *
  85. * @return an array of {@link OpenMBeanConstructorInfo} objects,
  86. * representing the constructors emitted by this
  87. * management bean.
  88. */
  89. MBeanConstructorInfo[] getConstructors();
  90. /**
  91. * Returns a description of this operation.
  92. *
  93. * @return a human-readable description.
  94. */
  95. String getDescription();
  96. /**
  97. * Returns descriptions of each of the notifications provided by this
  98. * management bean. The elements should be implementations of the
  99. * {@link OpenMBeanNotificationInfo} class.
  100. *
  101. * @return an array of {@link OpenMBeanNotificationInfo} objects,
  102. * representing the notifications emitted by this
  103. * management bean.
  104. */
  105. MBeanNotificationInfo[] getNotifications();
  106. /**
  107. * Returns descriptions of each of the operations provided by this
  108. * management bean. The elements should be implementations of the
  109. * {@link OpenMBeanOperationInfo} class.
  110. *
  111. * @return an array of {@link OpenMBeanOperationInfo} objects,
  112. * representing the operations emitted by this
  113. * management bean.
  114. */
  115. MBeanOperationInfo[] getOperations();
  116. /**
  117. * Returns the hashcode of the bean information as the sum of the
  118. * hashcodes of the class name and each array (calculated using
  119. * java.util.HashSet(<code>java.util.Arrays.asList(signature)).hashCode()</code>).
  120. *
  121. * @return the hashcode of the bean information.
  122. */
  123. int hashCode();
  124. /**
  125. * Returns a textual representation of this instance. This
  126. * is constructed using the class name
  127. * (<code>javax.management.openmbean.OpenMBeanInfo</code>)
  128. * along with the class name and textual representations
  129. * of each array.
  130. *
  131. * @return a @link{java.lang.String} instance representing
  132. * the instance in textual form.
  133. */
  134. String toString();
  135. }