Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   * Licensed to the Apache Software Foundation (ASF) under one or more
   * contributor license agreements.  See the NOTICE file distributed with
   * this work for additional information regarding copyright ownership.
   * The ASF licenses this file to You under the Apache License, Version 2.0
   * (the "License"); you may not use this file except in compliance with
   * the License.  You may obtain a copy of the License at
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
 package org.apache.tomcat.util.modeler;

Internal configuration information for an Operation descriptor.

Craig R. McClanahan
 public class OperationInfo extends FeatureInfo implements Serializable {
     static final long serialVersionUID = 4418342922072614875L;
     // ----------------------------------------------------------- Constructors

Standard zero-arguments constructor.
     public OperationInfo() {
     // ----------------------------------------------------- Instance Variables
     protected String impact = "UNKNOWN";
     protected String role = "operation";
     protected ParameterInfo parameters[] = new ParameterInfo[0];
     // ------------------------------------------------------------- Properties
The "impact" of this operation, which should be a (case-insensitive) string value "ACTION", "ACTION_INFO", "INFO", or "UNKNOWN".
     public String getImpact() {
         return (this.);
     public void setImpact(String impact) {
         if (impact == null)
             this. = null;
             this. = impact.toUpperCase(.);

The role of this operation ("getter", "setter", "operation", or "constructor").
     public String getRole() {
         return (this.);
     public void setRole(String role) {
         this. = role;

The fully qualified Java class name of the return type for this operation.
     public String getReturnType() {
         if( == null) {
              = "void";
         return ;
     public void setReturnType(String returnType) {
         this. = returnType;

The set of parameters for this operation.
    public ParameterInfo[] getSignature() {
        return (this.);
    // --------------------------------------------------------- Public Methods

Add a new parameter to the set of arguments for this operation.

parameter The new parameter descriptor
    public void addParameter(ParameterInfo parameter) {
        synchronized () {
            ParameterInfo results[] = new ParameterInfo[. + 1];
            System.arraycopy(, 0, results, 0, .);
            results[.] = parameter;
             = results;
            this. = null;

Create and return a ModelMBeanOperationInfo object that corresponds to the attribute described by this instance.
        // Return our cached information (if any)
        if ( == null) {
            // Create and return a new information object
            int impact = .;
            if ("ACTION".equals(getImpact()))
                impact = .;
            else if ("ACTION_INFO".equals(getImpact()))
                impact = .;
            else if ("INFO".equals(getImpact()))
                impact = .;
             = new MBeanOperationInfo(getName(), getDescription(), 
                                          getReturnType(), impact);
        return (MBeanOperationInfo);
    protected MBeanParameterInfo[] getMBeanParameterInfo() {
        ParameterInfo params[] = getSignature();
        MBeanParameterInfo parameters[] =
            new MBeanParameterInfo[params.length];
        for (int i = 0; i < params.lengthi++)
            parameters[i] = params[i].createParameterInfo();
        return parameters;
New to GrepCode? Check out our FAQ X