1. /*
  2. * @(#)OpenMBeanConstructorInfo.java 3.19 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.openmbean;
  8. // java import
  9. //
  10. // jmx import
  11. //
  12. import javax.management.MBeanParameterInfo;
  13. /**
  14. * <p>Describes a constructor of an Open MBean.</p>
  15. *
  16. * <p>This interface declares the same methods as the class {@link
  17. * javax.management.MBeanConstructorInfo}. A class implementing this
  18. * interface (typically {@link OpenMBeanConstructorInfoSupport})
  19. * should extend {@link javax.management.MBeanConstructorInfo}.</p>
  20. *
  21. * <p>The {@link #getSignature()} method should return at runtime an
  22. * array of instances of a subclass of {@link MBeanParameterInfo}
  23. * which implements the {@link OpenMBeanParameterInfo} interface
  24. * (typically {@link OpenMBeanParameterInfoSupport}).</p>
  25. *
  26. *
  27. * @version 3.19 03/12/19
  28. * @author Sun Microsystems, Inc.
  29. *
  30. * @since 1.5
  31. * @since.unbundled JMX 1.1
  32. */
  33. public interface OpenMBeanConstructorInfo {
  34. // Re-declares the methods that are in class MBeanConstructorInfo of JMX 1.0
  35. // (methods will be removed when MBeanConstructorInfo is made a parent interface of this interface)
  36. /**
  37. * Returns a human readable description of the constructor
  38. * described by this <tt>OpenMBeanConstructorInfo</tt> instance.
  39. *
  40. * @return the description.
  41. */
  42. public String getDescription() ;
  43. /**
  44. * Returns the name of the constructor
  45. * described by this <tt>OpenMBeanConstructorInfo</tt> instance.
  46. *
  47. * @return the name.
  48. */
  49. public String getName() ;
  50. /**
  51. * Returns an array of <tt>OpenMBeanParameterInfo</tt> instances
  52. * describing each parameter in the signature of the constructor
  53. * described by this <tt>OpenMBeanConstructorInfo</tt> instance.
  54. *
  55. * @return the signature.
  56. */
  57. public MBeanParameterInfo[] getSignature() ;
  58. // commodity methods
  59. //
  60. /**
  61. * Compares the specified <var>obj</var> parameter with this <code>OpenMBeanConstructorInfo</code> instance for equality.
  62. * <p>
  63. * Returns <tt>true</tt> if and only if all of the following statements are true:
  64. * <ul>
  65. * <li><var>obj</var> is non null,</li>
  66. * <li><var>obj</var> also implements the <code>OpenMBeanConstructorInfo</code> interface,</li>
  67. * <li>their names are equal</li>
  68. * <li>their signatures are equal.</li>
  69. * </ul>
  70. * This ensures that this <tt>equals</tt> method works properly for <var>obj</var> parameters which are
  71. * different implementations of the <code>OpenMBeanConstructorInfo</code> interface.
  72. * <br> 
  73. * @param obj the object to be compared for equality with this <code>OpenMBeanConstructorInfo</code> instance;
  74. *
  75. * @return <code>true</code> if the specified object is equal to this <code>OpenMBeanConstructorInfo</code> instance.
  76. */
  77. public boolean equals(Object obj);
  78. /**
  79. * Returns the hash code value for this <code>OpenMBeanConstructorInfo</code> instance.
  80. * <p>
  81. * The hash code of an <code>OpenMBeanConstructorInfo</code> instance is the sum of the hash codes
  82. * of all elements of information used in <code>equals</code> comparisons
  83. * (ie: its name and signature, where the signature hashCode is calculated by a call to
  84. * <tt>java.util.Arrays.asList(this.getSignature).hashCode()</tt>).
  85. * <p>
  86. * This ensures that <code> t1.equals(t2) </code> implies that <code> t1.hashCode()==t2.hashCode() </code>
  87. * for any two <code>OpenMBeanConstructorInfo</code> instances <code>t1</code> and <code>t2</code>,
  88. * as required by the general contract of the method
  89. * {@link Object#hashCode() Object.hashCode()}.
  90. * <p>
  91. *
  92. * @return the hash code value for this <code>OpenMBeanConstructorInfo</code> instance
  93. */
  94. public int hashCode();
  95. /**
  96. * Returns a string representation of this <code>OpenMBeanConstructorInfo</code> instance.
  97. * <p>
  98. * The string representation consists of the name of this class (ie <code>javax.management.openmbean.OpenMBeanConstructorInfo</code>),
  99. * and the name and signature of the described constructor.
  100. *
  101. * @return a string representation of this <code>OpenMBeanConstructorInfo</code> instance
  102. */
  103. public String toString();
  104. }