*/
protected void loadMessage(Element messageElement, String sName)
{
XMLMetadataHelper.verifyRootElement(messageElement, "Message");
final Message message = new Message(sName);
message.setMetadata(m_metadata);
message.setResourceName(m_helper.getCurResourceName());
String sFormat = XMLUtil.getStringAttr(messageElement, "format");
if (sFormat != null)
{
message.setFormat(m_metadata.getFormat(sFormat));
}
final String sResponse = XMLUtil.getStringAttr(messageElement, "response");
if (sResponse != null)
{
addPreInheritanceMessageFixup(new ContextFixup(getHelper())
{
public void fixup()
{
message.setResponse(m_metadata.getMessage(sResponse));
}
});
}
String sDerivation = XMLUtil.getStringAttr(messageElement, "derivation", "virtual");
if (sDerivation.equals("virtual"))
{
message.setDerivation(Message.DERIVATION_VIRTUAL);
}
else if (sDerivation.equals("final"))
{
message.setDerivation(Message.DERIVATION_FINAL);
}
else if (sDerivation.equals("abstract"))
{
message.setDerivation(Message.DERIVATION_ABSTRACT);
}
else
{
throw new MetadataException("err.meta.integration.messageDerivation",
new Object[] {sDerivation, message.getName()});
}
final String sBaseMessage = XMLUtil.getStringAttr(messageElement, "base");
if (!loadMessageRef(null, message, messageElement, sName))
{
CompositeMessagePart compMsgPart = new CompositeMessagePartInstance(sName);
message.setRoot(compMsgPart);
loadCompositeMessagePart(messageElement, compMsgPart, message);
}
m_metadata.addMessage(message);
if (sBaseMessage != null)
{
addPreInheritanceMessageFixup(new ContextFixup(m_helper)
{
public void fixup()
{
Message baseMessage = m_metadata.getMessage(sBaseMessage);
message.setBaseMessage(baseMessage);
baseMessage.addDerivedMessage(message);
}
});
}
}