return desc;
}
public Descriptor buildMBeanDescriptor(ManagedResource mr) {
Descriptor desc = new DescriptorSupport();
if (mr.componentName() != null) {
desc.setField("name", mr.componentName());
}
desc.setField("descriptorType", "mbean");
if (mr.description() != null) {
desc.setField("displayName", mr.description());
}
if (mr.persistLocation() != null) {
desc.setField("persistLocation", mr.persistLocation());
}
if (mr.persistName() != null) {
desc.setField("persistName", mr.persistName());
}
if (mr.log()) {
desc.setField("log", "true");
} else {
desc.setField("log", "false");
}
if (mr.persistPolicy() != null) {
desc.setField("persistPolicy", mr.persistPolicy());
}
if (mr.persistPeriod() >= -1) {
desc.setField("persistPeriod", mr.persistPeriod());
}
if (mr.logFile() != null) {
desc.setField("logFile", mr.logFile());
}
if (mr.currencyTimeLimit() >= -1) {
desc.setField("currencyTimeLimit", mr.currencyTimeLimit());
}
return desc;
}