FileDocCategorySizeDatePackage
ConnectorNode.javaAPI DocGlassfish v2 API6051Fri May 04 22:31:48 BST 2007com.sun.enterprise.deployment.node.runtime.connector

ConnectorNode

public class ConnectorNode extends com.sun.enterprise.deployment.node.runtime.RuntimeBundleNode
This node handles the sun-connector runtime deployment descriptors
author
Jerome Dochez
version

Fields Summary
protected com.sun.enterprise.deployment.runtime.connector.SunConnector
descriptor
protected com.sun.enterprise.deployment.ConnectorDescriptor
connector
Constructors Summary
public ConnectorNode(com.sun.enterprise.deployment.ConnectorDescriptor connector)
Initialize the child handlers

             
       
        
        // we do not care about our standard DDS handles
        handlers = null;
        
	this.connector = connector;
	
        registerElementHandler(new XMLElement(RuntimeTagNames.RESOURCE_ADAPTER), 
                               ResourceAdapterNode.class, "setResourceAdapter");
        registerElementHandler(new XMLElement(RuntimeTagNames.ROLE_MAP), 
                               RoleMapNode.class,"setRoleMap"); 
    
Methods Summary
public java.lang.ObjectgetDescriptor()

return
the descriptor instance to associate with this XMLNode

        if (descriptor==null) {
	    descriptor = new SunConnector();
            connector.setSunDescriptor(descriptor);
	}
        return descriptor;
    
public java.lang.StringgetDocType()

return
the DOCTYPE that should be written to the XML file

	return DTDRegistry.SUN_CONNECTOR_100_DTD_PUBLIC_ID;
    
public java.lang.StringgetSystemID()

return
the SystemID of the XML file

	return DTDRegistry.SUN_CONNECTOR_100_DTD_SYSTEM_ID;
    
public java.util.ListgetSystemIDs()

return
NULL for all runtime nodes.

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

        return new XMLElement(RuntimeTagNames.S1AS_CONNECTOR_RUNTIME_TAG);
    
public static java.lang.StringregisterBundle(java.util.Map publicIDToDTD)
register this node as a root node capable of loading entire DD files

param
publicIDToDTD is a mapping between xml Public-ID to DTD
return
the doctype tag name

    
       publicIDToDTD.put(DTDRegistry.SUN_CONNECTOR_100_DTD_PUBLIC_ID, DTDRegistry.SUN_CONNECTOR_100_DTD_SYSTEM_ID);
       return RuntimeTagNames.S1AS_CONNECTOR_RUNTIME_TAG;
   
public org.w3c.dom.NodewriteDescriptor(org.w3c.dom.Node parent, java.lang.String nodeName, 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
node name for the descriptor
param
the descriptor to write
return
the DOM tree top node

        if (!(descriptor instanceof ConnectorDescriptor)) {
            throw new IllegalArgumentException(getClass() + " cannot handles descriptors of type " + descriptor.getClass());
        }
        ConnectorDescriptor connector = (ConnectorDescriptor) descriptor;
            
	Node connectorNode = super.writeDescriptor(parent, nodeName, descriptor);
	
	// resource-adapter
        SunConnector sunDesc = connector.getSunDescriptor();
        if (sunDesc!=null) {
            ResourceAdapterNode ran = new ResourceAdapterNode();
            ran.writeDescriptor(connectorNode, RuntimeTagNames.RESOURCE_ADAPTER, sunDesc.getResourceAdapter());
	
            // role-map ?
            if (sunDesc.getRoleMap()!=null) {
                RoleMapNode rmn = new RoleMapNode();
                rmn.writeDescriptor(connectorNode, RuntimeTagNames.ROLE_MAP, sunDesc.getRoleMap());
            }
        }
	return connectorNode;