001: /* JFox, the OpenSource J2EE Application Server
002: *
003: * Copyright (C) 2002 huihoo.org
004: * Distributable under GNU LGPL license
005: * See the GNU Lesser General Public License for more details.
006: */
007:
008: package javax.management.openmbean;
009:
010: import javax.management.MBeanParameterInfo;
011:
012: /**
013: * <p>Describes a constructor of an Open MBean.</p>
014: *
015: * <p>This interface declares the same methods as the class {@link
016: * javax.management.MBeanConstructorInfo}. A class implementing this
017: * interface (typically {@link OpenMBeanConstructorInfoSupport})
018: * should extend {@link javax.management.MBeanConstructorInfo}.</p>
019: *
020: * <p>The {@link #getSignature()} method should return at runtime an
021: * array of instances of a subclass of {@link MBeanParameterInfo}
022: * which implements the {@link OpenMBeanParameterInfo} interface
023: * (typically {@link OpenMBeanParameterInfoSupport}).</p>
024: *
025: * @author <a href="mailto:young_yy@hotmail.org">Young Yang</a>
026: */
027:
028: public interface OpenMBeanConstructorInfo {
029:
030: // Re-declares the methods that are in class MBeanConstructorInfo of JMX 1.0
031: // (methods will be removed when MBeanConstructorInfo is made a parent interface of this interface)
032:
033: /**
034: * Returns a human readable description of the constructor
035: * described by this <tt>OpenMBeanConstructorInfo</tt> instance.
036: *
037: * @return the description.
038: */
039: public String getDescription();
040:
041: /**
042: * Returns the name of the constructor
043: * described by this <tt>OpenMBeanConstructorInfo</tt> instance.
044: *
045: * @return the name.
046: */
047: public String getName();
048:
049: /**
050: * Returns an array of <tt>OpenMBeanParameterInfo</tt> instances
051: * describing each parameter in the signature of the constructor
052: * described by this <tt>OpenMBeanConstructorInfo</tt> instance.
053: *
054: * @return the signature.
055: */
056: public MBeanParameterInfo[] getSignature();
057:
058: // commodity methods
059: //
060:
061: /**
062: * Compares the specified <var>obj</var> parameter with this <code>OpenMBeanConstructorInfo</code> instance for equality.
063: * <p>
064: * Returns <tt>true</tt> if and only if all of the following statements are true:
065: * <ul>
066: * <li><var>obj</var> is non null,</li>
067: * <li><var>obj</var> also implements the <code>OpenMBeanConstructorInfo</code> interface,</li>
068: * <li>their names are equal</li>
069: * <li>their signatures are equal.</li>
070: * </ul>
071: * This ensures that this <tt>equals</tt> method works properly for <var>obj</var> parameters which are
072: * different implementations of the <code>OpenMBeanConstructorInfo</code> interface.
073: * <br>
074: * @param obj the object to be compared for equality with this <code>OpenMBeanConstructorInfo</code> instance;
075: *
076: * @return <code>true</code> if the specified object is equal to this <code>OpenMBeanConstructorInfo</code> instance.
077: */
078: public boolean equals(Object obj);
079:
080: /**
081: * Returns the hash code value for this <code>OpenMBeanConstructorInfo</code> instance.
082: * <p>
083: * The hash code of an <code>OpenMBeanConstructorInfo</code> instance is the sum of the hash codes
084: * of all elements of information used in <code>equals</code> comparisons
085: * (ie: its name and signature, where the signature hashCode is calculated by a call to
086: * <tt>java.util.Arrays.asList(this.getSignature).hashCode()</tt>).
087: * <p>
088: * This ensures that <code> t1.equals(t2) </code> implies that <code> t1.hashCode()==t2.hashCode() </code>
089: * for any two <code>OpenMBeanConstructorInfo</code> instances <code>t1</code> and <code>t2</code>,
090: * as required by the general contract of the method
091: * {@link <a href="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#hashCode()">
092: * <code>Object.hashCode</code> </a>}.
093: * <p>
094: *
095: * @return the hash code value for this <code>OpenMBeanConstructorInfo</code> instance
096: */
097: public int hashCode();
098:
099: /**
100: * Returns a string representation of this <code>OpenMBeanConstructorInfo</code> instance.
101: * <p>
102: * The string representation consists of the name of this class (ie <code>javax.management.openmbean.OpenMBeanConstructorInfo</code>),
103: * and the name and signature of the described constructor.
104: *
105: * @return a string representation of this <code>OpenMBeanConstructorInfo</code> instance
106: */
107: public String toString();
108:
109: }
|