1 23 24 package com.sun.enterprise.deployment.node; 25 26 import java.util.*; 27 import org.w3c.dom.Node ; 28 29 import com.sun.enterprise.deployment.xml.WebServicesTagNames; 30 import com.sun.enterprise.deployment.WebService; 31 import com.sun.enterprise.deployment.WebServiceEndpoint; 32 import javax.xml.namespace.QName ; 33 34 40 public class WebServiceNode extends DisplayableComponentNode { 41 42 private final static XMLElement tag = 43 new XMLElement(WebServicesTagNames.WEB_SERVICE); 44 45 public WebServiceNode() { 46 super(); 47 registerElementHandler 48 (new XMLElement(WebServicesTagNames.PORT_COMPONENT), 49 WebServiceEndpointNode.class); 50 } 51 52 55 protected void Init() { 56 } 57 58 65 protected Map getDispatchTable() { 66 Map table = super.getDispatchTable(); 67 table.put(WebServicesTagNames.WEB_SERVICE_DESCRIPTION_NAME, 68 "setName"); 69 table.put(WebServicesTagNames.WSDL_FILE, "setWsdlFileUri"); 70 table.put(WebServicesTagNames.JAXRPC_MAPPING_FILE, "setMappingFileUri"); 71 return table; 72 } 73 74 77 protected XMLElement getXMLRootTag() { 78 return tag; 79 } 80 81 87 public void addDescriptor(Object descriptor) { 88 WebServiceEndpoint endpoint = (WebServiceEndpoint) descriptor; 89 WebService webService = (WebService) getDescriptor(); 90 webService.addEndpoint(endpoint); 91 } 92 93 102 public Node writeDescriptor(Node parent, String nodeName, 103 WebService descriptor) { 104 Node topNode = 105 super.writeDescriptor(parent, nodeName, descriptor); 106 107 writeDisplayableComponentInfo(topNode, descriptor); 108 109 appendTextChild(topNode, 110 WebServicesTagNames.WEB_SERVICE_DESCRIPTION_NAME, 111 descriptor.getName()); 112 appendTextChild(topNode, WebServicesTagNames.WSDL_FILE, 113 descriptor.getWsdlFileUri()); 114 appendTextChild(topNode, WebServicesTagNames.JAXRPC_MAPPING_FILE, 115 descriptor.getMappingFileUri()); 116 117 WebServiceEndpointNode endpointNode = new WebServiceEndpointNode(); 118 for(WebServiceEndpoint next : descriptor.getEndpoints()) { 119 endpointNode.writeDescriptor 120 (topNode, WebServicesTagNames.PORT_COMPONENT, next); 121 } 122 123 return topNode; 124 } 125 126 } 127 | Popular Tags |