e = UtlXML.xSearchElement(this.root, expr);
} catch (XPathExpressionException ex) {
throw new RuntimeException("Internal error", ex);
}
if (e == null)
throw new MessageTypeException("Unknown message type: "+messageType);
// Instantiate the class
String class_name = e.getAttribute(MessageTypesXML.ATTR_PROCESSOR);
MessageProcessor mp;
try {
mp = (MessageProcessor) Class.forName(class_name).newInstance();
} catch (Exception ex)
{
throw new MessageTypeException("Error instantiating the class: "+e.toString());
}
if (mp == null)
throw new MessageTypeException("It's not a processor: "+class_name);
// Return the processor
return mp;
}