use of javax.management.Descriptor in project cxf by apache.
the class ModelMBeanInfoSupporter method buildOperationDescriptor.
public Descriptor buildOperationDescriptor(ManagedOperation mo, String operationName) {
Descriptor desc = new DescriptorSupport();
desc.setField("name", operationName);
desc.setField("descriptorType", "operation");
desc.setField("role", "operation");
if (mo.description() != null) {
desc.setField("displayName", mo.description());
}
if (mo.currencyTimeLimit() >= -1) {
desc.setField("currencyTimeLimit", mo.currencyTimeLimit());
}
return desc;
}
use of javax.management.Descriptor in project cxf by apache.
the class ModelMBeanInfoSupporter method buildAttributeOperationDescriptor.
public Descriptor buildAttributeOperationDescriptor(String operationName) {
Descriptor desc = new DescriptorSupport();
desc.setField("name", operationName);
desc.setField("descriptorType", "operation");
if (operationName.indexOf("set") == 0) {
desc.setField("role", "setter");
} else {
desc.setField("role", "getter");
}
return desc;
}
use of javax.management.Descriptor in project cxf by apache.
the class ModelMBeanInfoSupporter method buildAttributeDescriptor.
public Descriptor buildAttributeDescriptor(ManagedAttribute ma, String attributeName, boolean is, boolean read, boolean write) {
Descriptor desc = new DescriptorSupport();
desc.setField("name", attributeName);
desc.setField("descriptorType", "attribute");
if (read) {
if (is) {
desc.setField("getMethod", "is" + attributeName);
} else {
desc.setField("getMethod", "get" + attributeName);
}
}
if (write) {
desc.setField("setMethod", "set" + attributeName);
}
if (ma.currencyTimeLimit() >= -1) {
desc.setField("currencyTimeLimit", ma.currencyTimeLimit());
}
if (ma.persistPolicy().length() > 0) {
desc.setField("persistPolicy", ma.persistPolicy());
}
if (ma.persistPeriod() >= -1) {
desc.setField("persistPeriod", ma.persistPeriod());
}
if (ma.defaultValue() != null) {
desc.setField("default", ma.defaultValue());
}
return desc;
}
use of javax.management.Descriptor in project Payara by payara.
the class MBeanInterfaceGenerator method getOperationComment.
public String getOperationComment(MBeanOperationInfo info, final String[] paramNames) {
final String description = info.getDescription();
final StringBuffer buf = new StringBuffer();
if (description != null && description.length() != 0) {
buf.append(description + NEWLINE);
}
final Descriptor desc = info.getDescriptor();
buf.append(toString(desc));
final MBeanParameterInfo[] signature = info.getSignature();
for (int i = 0; i < paramNames.length; ++i) {
final String paramDescription = signature[i].getDescription();
buf.append("@param " + paramNames[i] + " " + paramDescription + NEWLINE);
}
final String returnType = getCodeClassname(info.getReturnType());
if (!returnType.equals("void")) {
buf.append("@return " + returnType + NEWLINE);
}
return (makeJavadocComment(buf.toString()));
}
use of javax.management.Descriptor in project Payara by payara.
the class ConfigBeanJMXSupport method _getMBeanInfo.
private MBeanInfo _getMBeanInfo() {
final List<MBeanAttributeInfo> attrsList = new ArrayList<MBeanAttributeInfo>();
for (final AttributeMethodInfo info : mAttrInfos) {
attrsList.add(attributeToMBeanAttributeInfo(info));
}
for (final ElementMethodInfo e : mElementInfos) {
final MBeanAttributeInfo attrInfo = elementToMBeanAttributeInfo(e.method());
if (attrInfo != null) {
attrsList.add(attrInfo);
}
}
final MBeanAttributeInfo[] attrs = new MBeanAttributeInfo[attrsList.size()];
attrsList.toArray(attrs);
final String classname = mIntf.getName();
final String description = "ConfigBean " + mIntf.getName();
final MBeanOperationInfo[] operations = toMBeanOperationInfos();
final Descriptor descriptor = descriptor();
final MBeanNotificationInfo[] notifications = new MBeanNotificationInfo[] { ATTRIBUTE_CHANGE_NOTIF_INFO };
final MBeanInfo info = new MBeanInfo(classname, description, attrs, null, operations, notifications, descriptor);
return info;
}
Aggregations