MessageDestinationRuntimeNodepublic class MessageDestinationRuntimeNode extends com.sun.enterprise.deployment.node.DeploymentDescriptorNode This node is responsible for handling runtime descriptor
message-destination tag. |
Fields Summary |
---|
private com.sun.enterprise.deployment.MessageDestinationDescriptor | descriptor |
Methods Summary |
---|
public java.lang.Object | getDescriptor()
return descriptor;
| protected java.util.Map | getDispatchTable()all sub-implementation of this class can use a dispatch table to map xml element to
method name on the descriptor class for setting the element value.
Map table = super.getDispatchTable();
table.put(RuntimeTagNames.JNDI_NAME, "setJndiName");
return table;
| public void | setElementValue(com.sun.enterprise.deployment.node.XMLElement element, java.lang.String value)receives notiification of the value for a particular tag
if (RuntimeTagNames.MESSAGE_DESTINATION_NAME.equals(element.getQName())) {
// this is a hack but not much choice
Object parentNode = getParentNode();
Object parentDesc = null;
if (parentNode instanceof WebBundleRuntimeNode) {
parentDesc = ((WebBundleRuntimeNode) parentNode).getWebBundleDescriptor();
} else {
parentDesc = getParentNode().getDescriptor();
}
if (parentDesc instanceof BundleDescriptor) {
try {
descriptor = ((BundleDescriptor) parentDesc).
getMessageDestinationByName(value);
} catch (IllegalArgumentException iae) {
DOLUtils.getDefaultLogger().warning(iae.getMessage());
}
}
} else super.setElementValue(element, value);
| public org.w3c.dom.Node | writeDescriptor(org.w3c.dom.Node parent, java.lang.String nodeName, com.sun.enterprise.deployment.MessageDestinationDescriptor msgDest)write the descriptor class to a DOM tree and return it
String jndiName = msgDest.getJndiName();
Node msgDestNode = null;
if( (jndiName != null) && (jndiName.length() > 0) ) {
msgDestNode = super.writeDescriptor(parent, nodeName, msgDest);
appendTextChild(msgDestNode,
RuntimeTagNames.MESSAGE_DESTINATION_NAME,
msgDest.getName());
appendTextChild(msgDestNode, RuntimeTagNames.JNDI_NAME,
msgDest.getJndiName());
}
return msgDestNode;
|
|