*/
public class BrokerConfigurationHelper {
public static BrokerConfiguration fromOM(OMElement brokerConfigOMElement) {
BrokerConfiguration brokerConfiguration = new BrokerConfiguration();
brokerConfiguration.setName(brokerConfigOMElement.getAttributeValue(
new QName("", BMConstants.BM_ATTR_NAME)));
brokerConfiguration.setType(brokerConfigOMElement.getAttributeValue(
new QName("", BMConstants.BM_ATTR_TYPE)));
Iterator propertyIter = brokerConfigOMElement.getChildrenWithName(
new QName(BMConstants.BM_CONF_NS, BMConstants.BM_ELE_PROPERTY));
OMElement propertyOMElement = null;
for (; propertyIter.hasNext();) {
propertyOMElement = (OMElement) propertyIter.next();
String name = propertyOMElement.getAttributeValue(
new QName("", BMConstants.BM_ATTR_NAME));
String value = propertyOMElement.getText();
brokerConfiguration.addProperty(name, value);
}
return brokerConfiguration;
}