FileDocCategorySizeDatePackage
WebServicesDescriptorNode.javaAPI DocGlassfish v2 API7335Fri May 04 22:31:40 BST 2007com.sun.enterprise.deployment.node

WebServicesDescriptorNode

public class WebServicesDescriptorNode extends BundleNode implements com.sun.enterprise.deployment.node.RootXMLNode
Root node for webservices deployment descriptor
author
Kenneth Saks
version

Fields Summary
public static final com.sun.enterprise.deployment.node.XMLElement
ROOT_ELEMENT
public static final String
SCHEMA_ID
public static final String
SPEC_VERSION
private static final List
systemIDs
private com.sun.enterprise.deployment.BundleDescriptor
bundleDescriptor
Constructors Summary
public WebServicesDescriptorNode(com.sun.enterprise.deployment.BundleDescriptor descriptor)

        bundleDescriptor = descriptor;
        registerElementHandler(new XMLElement(WebServicesTagNames.WEB_SERVICE),
                               WebServiceNode.class);
    
public WebServicesDescriptorNode()

        this(null);
    
Methods Summary
public voidaddDescriptor(java.lang.Object descriptor)
Adds a new DOL descriptor instance to the descriptor instance associated with this XMLNode

param
descriptor the new descriptor

    
        WebServicesDescriptor webServicesDesc = 
            bundleDescriptor.getWebServices();
        WebService webService = (WebService) descriptor;
        webServicesDesc.addWebService(webService);
        
        for(Iterator iter = webService.getEndpoints().iterator(); 
            iter.hasNext();) {
            WebServiceEndpoint next = (WebServiceEndpoint) iter.next();
            if( !next.resolveComponentLink() ) {
                DOLUtils.getDefaultLogger().info("Warning: Web service endpoint " + next.getEndpointName() + " component link " + next.getLinkName() + " is not valid");                
            }
        }
        
    
public java.lang.ObjectgetDescriptor()

return
the descriptor instance to associate with this XMLNode

        return bundleDescriptor;
    
public java.lang.StringgetDocType()

return
the DOCTYPE of the XML file

        return null;
    
protected java.lang.StringgetSchemaURL()

return
the complete URL for J2EE schemas

       return WebServicesTagNames.IBM_NAMESPACE + "/" + getSystemID();
    
public java.lang.StringgetSpecVersion()

return
the default spec version level this node complies to

        return SPEC_VERSION;
    
public java.lang.StringgetSystemID()

return
the SystemID of the XML file

        return SCHEMA_ID;
    
public java.util.ListgetSystemIDs()

return
the list of SystemID of the XML schema supported

        return systemIDs;
    
protected com.sun.enterprise.deployment.node.XMLElementgetXMLRootTag()

return
the XML tag associated with this XMLNode

        return ROOT_ELEMENT;
    
private static final java.util.ListinitSystemIDs()


         
        List<String> systemIDs = new ArrayList<String>();
        systemIDs.add(SCHEMA_ID);
        return Collections.unmodifiableList(systemIDs);
    
public voidsetElementValue(com.sun.enterprise.deployment.node.XMLElement element, java.lang.String value)
receives notiification of the value for a particular tag

param
element the xml element
param
value it's associated value

    
        if (TagNames.VERSION.equals(element.getQName())) {    
            bundleDescriptor.getWebServices().setSpecVersion(value);
        } else super.setElementValue(element, value);
    
public org.w3c.dom.NodewriteDescriptor(org.w3c.dom.Node parent, com.sun.enterprise.deployment.Descriptor descriptor)
write the descriptor class to a DOM tree and return it

param
parent node for the DOM tree
param
the descriptor to write
return
the DOM tree top node

    
        Node topNode = parent;
        if (parent instanceof Document) {
            BundleDescriptor bundleDesc = (BundleDescriptor) descriptor;
            WebServicesDescriptor webServicesDesc = bundleDesc.getWebServices();
            topNode = super.writeDescriptor(parent, webServicesDesc);
            WebServiceNode wsNode = new WebServiceNode();
            for(WebService next : webServicesDesc.getWebServices()) {
                wsNode.writeDescriptor(topNode, WebServicesTagNames.WEB_SERVICE,
                                       next);
            }
        }
        return parent;