MessageNodepublic class MessageNode extends com.sun.enterprise.deployment.node.DeploymentDescriptorNode This node handles message element |
Fields Summary |
---|
com.sun.enterprise.deployment.runtime.common.MessageDescriptor | descriptor | private static final String | ALL_METHODS |
Constructors Summary |
---|
public MessageNode()
registerElementHandler(new XMLElement(
RuntimeTagNames.JAVA_METHOD), MethodNode.class,
"setMethodDescriptor");
|
Methods Summary |
---|
public java.lang.Object | getDescriptor()
if (descriptor == null) {
descriptor = new MessageDescriptor();
setMiscDescriptors();
}
return descriptor;
| public void | setElementValue(com.sun.enterprise.deployment.node.XMLElement element, java.lang.String value)receives notification of the value for a particular tag
if (WebServicesTagNames.OPERATION_NAME.equals(element.getQName())) {
descriptor.setOperationName(value);
} else {
super.setElementValue(element, value);
}
| private void | setMiscDescriptors()
XMLNode parentNode =
getParentNode().getParentNode().getParentNode();
// get the endpoint or portinfo descriptor
Object parentDesc = parentNode.getDescriptor();
if (parentDesc instanceof ServiceRefPortInfo) {
descriptor.setServiceRefPortInfo((ServiceRefPortInfo)parentDesc);
} else if(parentDesc instanceof WebServiceEndpoint) {
descriptor.setWebServiceEndpoint((WebServiceEndpoint)parentDesc);
}
// Get the bundle descriptor of which this belongs
BundleDescriptor bundleDesc = null;
parentNode = parentNode.getParentNode().getParentNode();
if (parentNode instanceof WebBundleRuntimeNode) {
// In the cases of used in
// 1. webservice-endpoint for web component
// 2. port-info for web component
bundleDesc =
((WebBundleRuntimeNode)parentNode).getWebBundleDescriptor();
} else if (parentNode.getDescriptor() instanceof BundleDescriptor) {
// In the cases of used in port-info for app client
bundleDesc = (BundleDescriptor)parentNode.getDescriptor();
} else {
// In the case of used in webservice-endpoint for ejb component
if (parentNode.getDescriptor() instanceof EjbDescriptor) {
EjbDescriptor ejbDesc =
(EjbDescriptor)parentNode.getDescriptor();
bundleDesc = ejbDesc.getEjbBundleDescriptor();
} else {
// In the case of used in port-info for ejb component
parentNode = parentNode.getParentNode();
if (parentNode.getDescriptor() instanceof EjbDescriptor) {
EjbDescriptor ejbDesc =
(EjbDescriptor)parentNode.getDescriptor();
bundleDesc = ejbDesc.getEjbBundleDescriptor();
}
}
}
descriptor.setBundleDescriptor(bundleDesc);
| public org.w3c.dom.Node | writeDescriptor(org.w3c.dom.Node parent, java.lang.String nodeName, com.sun.enterprise.deployment.runtime.common.MessageDescriptor messageDesc)write the descriptor class to a DOM tree and return it
Node messageNode = super.writeDescriptor(parent, nodeName,
messageDesc);
// for empty message case, set the method descriptor
// to a method descriptor with "*" as name
if (messageDesc.getOperationName() == null &&
messageDesc.getMethodDescriptor() == null) {
MethodDescriptor allMethodDesc = new MethodDescriptor();
allMethodDesc.setName(ALL_METHODS);
messageDesc.setMethodDescriptor(allMethodDesc);
}
// java-method
MethodDescriptor methodDesc = messageDesc.getMethodDescriptor();
if (methodDesc != null) {
MethodNode methodNode = new MethodNode();
methodNode.writeJavaMethodDescriptor(messageNode,
RuntimeTagNames.JAVA_METHOD, methodDesc);
}
// operation-name
appendTextChild(messageNode, WebServicesTagNames.OPERATION_NAME,
messageDesc.getOperationName());
return messageNode;
|
|