📄 mbeanoperationdescriptor.java
字号:
/*
======================================================================
XMLOpenMBeanOperationInfo.java
Created by Claude Duguay
Copyright (c) 2005
======================================================================
*/
package com.claudeduguay.mbeans.model;
import java.util.*;
import javax.management.*;
import javax.management.modelmbean.*;
import org.jdom.*;
import com.claudeduguay.util.jdom.*;
public class MBeanOperationDescriptor
extends MBeanConstructorDescriptor
implements IStorableElement
{
protected String type;
protected String impact;
public MBeanOperationDescriptor() {}
public MBeanOperationDescriptor(Element element)
{
parseElement(element);
}
public ModelMBeanOperationInfo createMBeanOperationInfo()
{
MBeanParameterInfo[] signatureArray = createMBeanParameterInfoArray();
int impact = Integer.parseInt(getImpact());
return new ModelMBeanOperationInfo(name, description, signatureArray, getType(), impact);
}
public String getType()
{
return type == null ? "void" : type;
}
public void setType(String type)
{
this.type = type;
}
public String getImpact()
{
return impact != null ? impact : "1";
}
public void setImpact(String impact)
{
this.impact = impact;
}
public Element buildElement()
{
Element element = super.buildElement();
element.setName("operation");
element.setAttribute("type", getType());
element.setAttribute("imact", "" + getImpact());
return element;
}
public void parseElement(Element element)
{
super.parseElement(element);
setType(element.getAttributeValue("type"));
setImpact(element.getAttributeValue("impact"));
List children = element.getChildren();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -