ServletNodepublic class ServletNode extends com.sun.enterprise.deployment.node.DeploymentDescriptorNode This node is handling all runtime deployment descriptors
relative to servlets |
Fields Summary |
---|
private com.sun.enterprise.deployment.WebComponentDescriptor | descriptor |
Constructors Summary |
---|
public ServletNode()
registerElementHandler(new XMLElement
(WebServicesTagNames.WEB_SERVICE_ENDPOINT),
WebServiceEndpointRuntimeNode.class);
|
Methods Summary |
---|
public java.lang.Object | getDescriptor()
return descriptor;
| 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.SERVLET_NAME.equals(element.getQName())) {
Object parentDesc = ((WebBundleRuntimeNode) getParentNode()).getWebBundleDescriptor();
if (parentDesc instanceof WebBundleDescriptor) {
descriptor = ((WebBundleDescriptor) parentDesc).getWebComponentByCanonicalName(value);
}
} else if (RuntimeTagNames.PRINCIPAL_NAME.equals(element.getQName())) {
if (descriptor!=null && descriptor.getRunAsIdentity()!=null) {
descriptor.getRunAsIdentity().setPrincipal(value);
}
} else super.setElementValue(element, value);
| public org.w3c.dom.Node | writeDescriptor(org.w3c.dom.Node parent, java.lang.String nodeName, com.sun.enterprise.deployment.WebComponentDescriptor descriptor)write the descriptor class to a DOM tree and return it
WebServicesDescriptor webServices =
descriptor.getWebBundleDescriptor().getWebServices();
// only write servlet runtime elements if there is a runas identity
// or the servlet is exposed as a web service
if ( (descriptor.getRunAsIdentity() != null) ||
webServices.hasEndpointsImplementedBy(descriptor) ) {
Node servletNode = appendChild(parent, nodeName);
appendTextChild(servletNode, RuntimeTagNames.SERVLET_NAME, descriptor.getCanonicalName());
if( descriptor.getRunAsIdentity() != null ) {
appendTextChild(servletNode, RuntimeTagNames.PRINCIPAL_NAME,
descriptor.getRunAsIdentity().getPrincipal());
}
WebServiceEndpointRuntimeNode wsRuntime =
new WebServiceEndpointRuntimeNode();
wsRuntime.writeWebServiceEndpointInfo(servletNode, descriptor);
return servletNode;
}
return null;
|
|