OpenMBeanOperationInfo.java 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. /* OpenMBeanOperationInfo.java -- Open typed info about a operation.
  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.MBeanParameterInfo;
  33. /**
  34. * Describes a operation for an open management bean.
  35. * This interface includes those methods specified by {@link
  36. * javax.management.MBeanOperationInfo}, so implementations should
  37. * extend this class. The {@link #getSignature()} method should
  38. * return an array containing instances of {@link OpenMBeanParameterInfo}.
  39. *
  40. * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
  41. * @since 1.5
  42. */
  43. public interface OpenMBeanOperationInfo
  44. {
  45. /**
  46. * Compares this attribute with the supplied object. This returns
  47. * true iff the object is an instance of {@link OpenMBeanOperationInfo}
  48. * with an equal name, signature, open return type and impact.
  49. *
  50. * @param obj the object to compare.
  51. * @return true if the object is a {@link OpenMBeanParameterInfo}
  52. * instance,
  53. * <code>name.equals(object.getName())</code>,
  54. * <code>signature.equals(object.getSignature())</code>,
  55. * <code>returnOpenType.equals(object.getReturnOpenType())</code>,
  56. * and <code>impact == object.getImpact()</code>.
  57. */
  58. boolean equals(Object obj);
  59. /**
  60. * Returns a description of this operation.
  61. *
  62. * @return a human-readable description.
  63. */
  64. String getDescription();
  65. /**
  66. * <p>
  67. * Returns the impact of performing this operation.
  68. * The value is equal to one of the following:
  69. * </p>
  70. * <ol>
  71. * <li>{@link javax.management.MBeanOperationInfo#INFO}
  72. * &mdash; the method just returns
  73. * information (akin to an accessor).</li>
  74. * <li>{@link javax.management.MBeanOperationInfo#ACTION}
  75. * the method just alters the state of the bean, without
  76. * returning a value (akin to a mutator).</li>
  77. * <li>{@link javax.management.MBeanOperationInfo#ACTION_INFO}
  78. * the method both makes state changes and returns a value.</li>
  79. * <li>{@link javax.management.MBeanOperationInfo#UNKNOWN}
  80. * the behaviour of the operation is unknown.</li>
  81. * </ol>
  82. *
  83. * @return the impact of performing the operation.
  84. */
  85. int getImpact();
  86. /**
  87. * Returns the name of this operation.
  88. *
  89. * @return the name of the operation.
  90. */
  91. String getName();
  92. /**
  93. * Returns the open type instance which represents the type of the
  94. * return value.
  95. *
  96. * @return the open type of the return value.
  97. */
  98. OpenType<?> getReturnOpenType();
  99. /**
  100. * Returns the return type of the operation, as the class
  101. * name. This should be identical to
  102. * <code>getReturnOpenType.getClassName()</code>.
  103. *
  104. * @return the return type.
  105. */
  106. String getReturnType();
  107. /**
  108. * Returns the operation's signature, in the form of
  109. * information on each parameter. Each parameter is
  110. * described by an instance of {@link OpenMBeanParameterInfo}.
  111. *
  112. * @return an array of {@link OpenMBeanParameterInfo} objects,
  113. * describing the operation parameters.
  114. */
  115. MBeanParameterInfo[] getSignature();
  116. /**
  117. * Returns the hashcode of the operation information as the sum of
  118. * the hashcodes of the name, open return type, impact and signature
  119. * (calculated by
  120. * <code>java.util.Arrays.asList(signature).hashCode()</code>).
  121. *
  122. * @return the hashcode of the operation information.
  123. */
  124. int hashCode();
  125. /**
  126. * Returns a textual representation of this instance. This
  127. * is constructed using the class name
  128. * (<code>javax.management.openmbean.OpenMBeanOperationInfo</code>)
  129. * along with the name, signature, open return type and impact.
  130. *
  131. * @return a @link{java.lang.String} instance representing
  132. * the instance in textual form.
  133. */
  134. String toString();
  135. }