// Protected -----------------------------------------------------
protected Descriptor getDescriptor(final Element parent, final String infoName, final String type) throws NotCompliantMBeanException
{
Descriptor descr = new DescriptorSupport();
descr.setField(NAME, infoName);
descr.setField(DESCRIPTOR_TYPE, type);
Element descriptors = parent.getChild("descriptors");
if (descriptors == null)
{
return descr;
} // end of if ()
for (Iterator i = descriptors.getChildren().iterator(); i.hasNext();)
{
Element descriptor = (Element)i.next();
String name = descriptor.getName();
if (name.equals("persistence"))
{
Attribute persistPolicy = descriptor.getAttribute(PERSIST_POLICY);
Attribute persistPeriod = descriptor.getAttribute(PERSIST_PERIOD);
Attribute persistLocation = descriptor.getAttribute(PERSIST_LOCATION);
Attribute persistName = descriptor.getAttribute(PERSIST_NAME);
if (persistPolicy != null)
{
String value = persistPolicy.getValue();
validate(value, PERSIST_POLICY_LIST);
descr.setField(PERSIST_POLICY, value);
}
if (persistPeriod != null)
{
descr.setField(PERSIST_PERIOD, persistPeriod.getValue());
}
if (persistLocation != null)
{
descr.setField(PERSIST_LOCATION, persistLocation.getValue());
}
if (persistName != null)
{
descr.setField(PERSIST_NAME, persistName.getValue());
}
}
else if (name.equals(CURRENCY_TIME_LIMIT))
{
descr.setField(CURRENCY_TIME_LIMIT, descriptor.getAttributeValue("value"));
} // end of else
else if (name.equals(STATE_ACTION_ON_UPDATE))
{
String value = descriptor.getAttributeValue("value");
validate(value, STATE_ACTION_ON_UPDATE_LIST);
descr.setField(STATE_ACTION_ON_UPDATE, value);
} // end of else
else if (name.equals(DEFAULT))
{
String value = descriptor.getAttributeValue("value");
descr.setField(DEFAULT, value);
}
else if (name.equals("display-name"))
{
String value = descriptor.getAttributeValue("value");
descr.setField(DISPLAY_NAME, value);
}
else if (name.equals(VALUE))
{
String value = descriptor.getAttributeValue("value");
descr.setField(VALUE, value);
}
else if (name.equals(PERSISTENCE_MANAGER))
{
descr.setField(PERSISTENCE_MANAGER, descriptor.getAttributeValue("value"));
} // end of else
else if (name.equals(DESCRIPTOR))
{
descr.setField(descriptor.getAttributeValue("name"), descriptor.getAttributeValue("value"));
} // end of else
} // end of for ()
return descr;
}