in modules/core/src/main/java/org/apache/savan/configuration/ConfigurationManager.java [194:232]
private void processProtocol(OMElement element) throws SavanException {
Protocol protocol = new Protocol();
OMElement nameElement = element.getFirstChildWithName(new QName(NAME));
if (nameElement == null)
throw new SavanException("Protocol must have a 'Name' subelement");
String name = nameElement.getText();
protocol.setName(name);
OMElement utilFactoryNameElement = element.getFirstChildWithName(new QName(UTIL_FACTORY));
if (utilFactoryNameElement == null)
throw new SavanException("Protocol must have a 'UtilFactory' subelement");
String utilFactoryName = utilFactoryNameElement.getText();
Object obj = getObject(utilFactoryName);
if (!(obj instanceof UtilFactory))
throw new SavanException("UtilFactory element" + utilFactoryName +
"is not a subtype of the UtilFactory class");
protocol.setUtilFactory((UtilFactory)obj);
OMElement mappingRulesElement = element.getFirstChildWithName(new QName(MAPPING_RULES));
if (mappingRulesElement == null)
throw new SavanException("Protocol must have a 'mappingRules' sub-element");
processMappingRules(mappingRulesElement, protocol);
OMElement defaultSubscriberElement =
element.getFirstChildWithName(new QName(DEFAULT_SUBSCRIBER));
if (defaultSubscriberElement == null)
throw new SavanException("Protocols must have a 'defaultSubscriber' sub-element");
String defaultSubscriber = defaultSubscriberElement.getText();
protocol.setDefaultSubscriber(defaultSubscriber);
OMElement defaultFilterElement = element.getFirstChildWithName(new QName(DEFAULT_FILTER));
if (defaultFilterElement == null)
throw new SavanException("Protocols must have a 'defaultFilter' sub-element");
String defaultFilter = defaultFilterElement.getText();
protocol.setDefaultFilter(defaultFilter);
protocolMap.put(protocol.getName(), protocol);
}