FileDocCategorySizeDatePackage
OperationInfo.javaAPI DocApache Tomcat 6.0.144963Fri Jul 20 04:20:32 BST 2007org.apache.tomcat.util.modeler

OperationInfo

public class OperationInfo extends FeatureInfo implements Serializable

Internal configuration information for an Operation descriptor.

author
Craig R. McClanahan

Fields Summary
static final long
serialVersionUID
protected String
impact
protected String
role
protected ParameterInfo[]
parameters
Constructors Summary
public OperationInfo()
Standard zero-arguments constructor.

    // ----------------------------------------------------------- Constructors


            
      

        super();

    
Methods Summary
public voidaddParameter(ParameterInfo parameter)
Add a new parameter to the set of arguments for this operation.

param
parameter The new parameter descriptor


        synchronized (parameters) {
            ParameterInfo results[] = new ParameterInfo[parameters.length + 1];
            System.arraycopy(parameters, 0, results, 0, parameters.length);
            results[parameters.length] = parameter;
            parameters = results;
            this.info = null;
        }

    
javax.management.MBeanOperationInfocreateOperationInfo()
Create and return a ModelMBeanOperationInfo object that corresponds to the attribute described by this instance.


        // Return our cached information (if any)
        if (info == null) {
            // Create and return a new information object
            int impact = MBeanOperationInfo.UNKNOWN;
            if ("ACTION".equals(getImpact()))
                impact = MBeanOperationInfo.ACTION;
            else if ("ACTION_INFO".equals(getImpact()))
                impact = MBeanOperationInfo.ACTION_INFO;
            else if ("INFO".equals(getImpact()))
                impact = MBeanOperationInfo.INFO;
    
            info = new MBeanOperationInfo(getName(), getDescription(), 
                                          getMBeanParameterInfo(),
                                          getReturnType(), impact);
        }
        return (MBeanOperationInfo)info;
    
public java.lang.StringgetImpact()
The "impact" of this operation, which should be a (case-insensitive) string value "ACTION", "ACTION_INFO", "INFO", or "UNKNOWN".



    // ------------------------------------------------------------- Properties

                          
       
        return (this.impact);
    
protected javax.management.MBeanParameterInfo[]getMBeanParameterInfo()

        ParameterInfo params[] = getSignature();
        MBeanParameterInfo parameters[] =
            new MBeanParameterInfo[params.length];
        for (int i = 0; i < params.length; i++)
            parameters[i] = params[i].createParameterInfo();
        return parameters;
    
public java.lang.StringgetReturnType()
The fully qualified Java class name of the return type for this operation.

        if(type == null) {
            type = "void";
        }
        return type;
    
public java.lang.StringgetRole()
The role of this operation ("getter", "setter", "operation", or "constructor").

        return (this.role);
    
public ParameterInfo[]getSignature()
The set of parameters for this operation.

        return (this.parameters);
    
public voidsetImpact(java.lang.String impact)

        if (impact == null)
            this.impact = null;
        else
            this.impact = impact.toUpperCase();
    
public voidsetReturnType(java.lang.String returnType)

        this.type = returnType;
    
public voidsetRole(java.lang.String role)

        this.role = role;