KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > management > openmbean > OpenMBeanOperationInfo


1 /*
2  * @(#)OpenMBeanOperationInfo.java 3.20 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
8
9 package javax.management.openmbean;
10
11
12 // java import
13
//
14

15
16 // jmx import
17
//
18
import javax.management.MBeanParameterInfo JavaDoc;
19 import javax.management.MBeanOperationInfo JavaDoc;
20
21
22 /**
23  * <p>Describes an operation of an Open MBean.</p>
24  *
25  * <p>This interface declares the same methods as the class {@link
26  * javax.management.MBeanOperationInfo}. A class implementing this
27  * interface (typically {@link OpenMBeanOperationInfoSupport}) should
28  * extend {@link javax.management.MBeanOperationInfo}.</p>
29  *
30  * <p>The {@link #getSignature()} method should return at runtime an
31  * array of instances of a subclass of {@link MBeanParameterInfo}
32  * which implements the {@link OpenMBeanParameterInfo} interface
33  * (typically {@link OpenMBeanParameterInfoSupport}).</p>
34  *
35  * @version 3.20 03/12/19
36  * @author Sun Microsystems, Inc.
37  *
38  * @since 1.5
39  * @since.unbundled JMX 1.1
40  */

41 public interface OpenMBeanOperationInfo {
42
43     // Re-declares fields and methods that are in class MBeanOperationInfo of JMX 1.0
44
// (fields and methods will be removed when MBeanOperationInfo is made a parent interface of this interface)
45

46     /**
47      * Returns a human readable description of the operation
48      * described by this <tt>OpenMBeanOperationInfo</tt> instance.
49      *
50      * @return the description.
51      */

52     public String JavaDoc getDescription() ;
53
54     /**
55      * Returns the name of the operation
56      * described by this <tt>OpenMBeanOperationInfo</tt> instance.
57      *
58      * @return the name.
59      */

60     public String JavaDoc getName() ;
61
62     /**
63      * Returns an array of <tt>OpenMBeanParameterInfo</tt> instances
64      * describing each parameter in the signature of the operation
65      * described by this <tt>OpenMBeanOperationInfo</tt> instance.
66      * Each instance in the returned array should actually be a
67      * subclass of <tt>MBeanParameterInfo</tt> which implements the
68      * <tt>OpenMBeanParameterInfo</tt> interface (typically {@link
69      * OpenMBeanParameterInfoSupport}).
70      *
71      * @return the signature.
72      */

73     public MBeanParameterInfo JavaDoc[] getSignature() ;
74
75     /**
76      * Returns an <tt>int</tt> constant qualifying the impact of the
77      * operation described by this <tt>OpenMBeanOperationInfo</tt>
78      * instance.
79      *
80      * The returned constant is one of {@link
81      * javax.management.MBeanOperationInfo#INFO}, {@link
82      * javax.management.MBeanOperationInfo#ACTION} or {@link
83      * javax.management.MBeanOperationInfo#ACTION_INFO}.
84      *
85      * @return the impact code.
86      */

87     public int getImpact() ;
88
89     /**
90      * Returns the fully qualified Java class name of the values
91      * returned by the operation described by this
92      * <tt>OpenMBeanOperationInfo</tt> instance. This method should
93      * return the same value as a call to
94      * <tt>getReturnOpenType().getClassName()</tt>.
95      *
96      * @return the return type.
97      */

98     public String JavaDoc getReturnType() ;
99
100
101     // Now declares methods that are specific to open MBeans
102
//
103

104     /**
105      * Returns the <i>open type</i> of the values returned by the
106      * operation described by this <tt>OpenMBeanOperationInfo</tt>
107      * instance.
108      *
109      * @return the return type.
110      */

111     public OpenType JavaDoc getReturnOpenType() ; // open MBean specific method
112

113
114     // commodity methods
115
//
116

117     /**
118      * Compares the specified <var>obj</var> parameter with this <code>OpenMBeanOperationInfo</code> instance for equality.
119      * <p>
120      * Returns <tt>true</tt> if and only if all of the following statements are true:
121      * <ul>
122      * <li><var>obj</var> is non null,</li>
123      * <li><var>obj</var> also implements the <code>OpenMBeanOperationInfo</code> interface,</li>
124      * <li>their names are equal</li>
125      * <li>their signatures are equal</li>
126      * <li>their return open types are equal</li>
127      * <li>their impacts are equal</li>
128      * </ul>
129      * This ensures that this <tt>equals</tt> method works properly for <var>obj</var> parameters which are
130      * different implementations of the <code>OpenMBeanOperationInfo</code> interface.
131      * <br>&nbsp;
132      * @param obj the object to be compared for equality with this <code>OpenMBeanOperationInfo</code> instance;
133      *
134      * @return <code>true</code> if the specified object is equal to this <code>OpenMBeanOperationInfo</code> instance.
135      */

136     public boolean equals(Object JavaDoc obj);
137
138     /**
139      * Returns the hash code value for this <code>OpenMBeanOperationInfo</code> instance.
140      * <p>
141      * The hash code of an <code>OpenMBeanOperationInfo</code> instance is the sum of the hash codes
142      * of all elements of information used in <code>equals</code> comparisons
143      * (ie: its name, return open type, impact and signature, where the signature hashCode is calculated by a call to
144      * <tt>java.util.Arrays.asList(this.getSignature).hashCode()</tt>).
145      * <p>
146      * This ensures that <code> t1.equals(t2) </code> implies that <code> t1.hashCode()==t2.hashCode() </code>
147      * for any two <code>OpenMBeanOperationInfo</code> instances <code>t1</code> and <code>t2</code>,
148      * as required by the general contract of the method
149      * {@link Object#hashCode() Object.hashCode()}.
150      * <p>
151      *
152      * @return the hash code value for this <code>OpenMBeanOperationInfo</code> instance
153      */

154     public int hashCode();
155
156     /**
157      * Returns a string representation of this <code>OpenMBeanOperationInfo</code> instance.
158      * <p>
159      * The string representation consists of the name of this class (ie <code>javax.management.openmbean.OpenMBeanOperationInfo</code>),
160      * and the name, signature, return open type and impact of the described operation.
161      *
162      * @return a string representation of this <code>OpenMBeanOperationInfo</code> instance
163      */

164     public String JavaDoc toString();
165
166 }
167
Popular Tags