User: juhalindfors
Date: 02/02/24 05:56:56
Modified: src/main/javax/management MBeanOperationInfo.java
Log:
javadoc
Revision Changes Path
1.6 +87 -5 jmx/src/main/javax/management/MBeanOperationInfo.java
Index: MBeanOperationInfo.java
===================================================================
RCS file: /cvsroot/jboss/jmx/src/main/javax/management/MBeanOperationInfo.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- MBeanOperationInfo.java 21 Feb 2002 06:39:05 -0000 1.5
+++ MBeanOperationInfo.java 24 Feb 2002 13:56:56 -0000 1.6
@@ -6,6 +6,9 @@
*/
package javax.management;
+import java.lang.reflect.Method;
+import java.io.Serializable;
+
/**
* Describes an operation exposed by an MBean
*
@@ -15,25 +18,65 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Juha Lindfors</a>.
* @author <a href="mailto:[EMAIL PROTECTED]">Trevor Squires</a>.
*
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
*/
public class MBeanOperationInfo extends MBeanFeatureInfo
- implements java.io.Serializable, Cloneable
+ implements Serializable, Cloneable
{
- // Attributes ----------------------------------------------------
+ // Constants -----------------------------------------------------
+
+ /**
+ * Management operation impact: INFO. The operation should not alter the
+ * state of the MBean component (read operation).
+ */
public static final int INFO = 0;
+
+ /**
+ * Management operation impact: ACTION. The operation changes the state
+ * of the MBean component (write operation).
+ */
public static final int ACTION = 1;
+
+ /**
+ * Management operation impact: ACTION_INFO. Operation behaves like a
+ * read/write operation.
+ */
public static final int ACTION_INFO = 2;
+
+ /**
+ * Management operation impact: UNKNOWN. Reserved for Standard MBeans.
+ */
public static final int UNKNOWN = 3;
+
+ // Attributes ----------------------------------------------------
+
+ /**
+ * Impact of this operation.
+ */
private int impact = UNKNOWN;
+
+ /**
+ * Signature of this operation.
+ */
private MBeanParameterInfo[] signature = null;
+
+ /**
+ * Return type of this operation as a fully qualified class name.
+ */
private String returnType = null;
// Constructors --------------------------------------------------
- public MBeanOperationInfo(java.lang.String description,
- java.lang.reflect.Method method)
+
+ /**
+ * Constructs management operation metadata from a given <tt>Method</tt>
+ * object and description.
+ *
+ * @param description human readable description of this operation
+ * @param method used to build the metadata for the management operation
+ */
+ public MBeanOperationInfo(String description, Method method)
{
super(method.getName(), description);
this.returnType = method.getReturnType().getName();
@@ -48,6 +91,15 @@
}
}
+ /**
+ * Constructs a management operation metadata.
+ *
+ * @param name name of the management operation
+ * @param description human readable description string of the operation
+ * @param signature signature of the operation
+ * @param returnType return type of the operation as a fully qualified class
name
+ * @param impact impact of this operation: {@link #ACTION ACTION}, {@link
#INFO INFO}, {@link #ACTION_INFO ACTION_INFO} or {@link #UNKNOWN UNKNOWN}
+ */
public MBeanOperationInfo(String name, String description,
MBeanParameterInfo[] signature,
String returnType, int impact)
@@ -59,22 +111,51 @@
}
// Public --------------------------------------------------------
+
+ /**
+ * Returns a fully qualified class name of the return type of this operation.
+ *
+ * @return fully qualified class name
+ */
public String getReturnType()
{
return returnType;
}
+ /**
+ * Returns the signature of this operation. <b>Note:</b> an operation with a void
+ * signature returns a zero-length array, not a <tt>null</tt> reference.
+ *
+ * @return operation's signature
+ */
public MBeanParameterInfo[] getSignature()
{
return (MBeanParameterInfo[]) signature.clone();
}
+ /**
+ * Returns the impact of this operation. The impact is one of the following
values:
+ * {@link #ACTION ACTION}, {@link #INFO INFO}, {@link #ACTION_INFO ACTION_INFO}
or {@link #UNKNOWN UNKNOWN} (reserved for Standard MBeans).
+ *
+ * @return operation's impact
+ * @throws JMRuntimeException if the object contains an invalid impact value
+ */
public int getImpact()
{
+ if (impact != ACTION && impact != INFO && impact != ACTION_INFO && impact !=
UNKNOWN)
+ throw new JMRuntimeException("Invalid impact value (" + impact + "). The
impact must be either ACTION, INFO, ACTION_INFO or UNKNOWN.");
+
return impact;
}
// Cloneable implementation --------------------------------------
+ /**
+ * Creates a copy of this object. This is a deep copy; the
<tt>MBeanParameterInfo</tt> objects
+ * forming the operation's signature are also cloned.
+ *
+ * @return a clone of this object
+ * @throws CloneNotSupportedException if there was a failure trying to copy the
object
+ */
public synchronized Object clone() throws CloneNotSupportedException
{
MBeanOperationInfo clone = (MBeanOperationInfo) super.clone();
@@ -84,4 +165,5 @@
return clone;
}
+
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development