protected HandlerDescription processHandler(OMElement handler_element, ParameterInclude parent)
throws DeploymentException {
HandlerDescription handler = new HandlerDescription();
// Setting Handler name
OMAttribute name_attribute = handler_element.getAttribute(new QName(ATTRIBUTE_NAME));
if (name_attribute == null) {
throw new DeploymentException(Messages.getMessage(DeploymentErrorMsgs.INVALID_HANDLER,
"Name missing"));
} else {
handler.setName(new QName(name_attribute.getAttributeValue()));
}
// Setting Handler Class name
OMAttribute class_attribute = handler_element.getAttribute(new QName(TAG_CLASS_NAME));
if (class_attribute == null) {
throw new DeploymentException((Messages.getMessage(DeploymentErrorMsgs.INVALID_HANDLER,
"class name is missing")));
} else {
handler.setClassName(class_attribute.getAttributeValue());
}
// processing phase Rules (order)
OMElement order_element = handler_element.getFirstChildWithName(new QName(TAG_ORDER));
if (order_element == null) {
throw new DeploymentException((Messages.getMessage(DeploymentErrorMsgs.INVALID_HANDLER,
"phase rule has not been specified")));
} else {
Iterator order_itr = order_element.getAllAttributes();
while (order_itr.hasNext()) {
OMAttribute orderAttribute = (OMAttribute) order_itr.next();
String name = orderAttribute.getQName().getLocalPart();
String value = orderAttribute.getAttributeValue();
if (TAG_AFTER.equals(name)) {
handler.getRules().setAfter(value);
} else if (TAG_BEFORE.equals(name)) {
handler.getRules().setBefore(value);