FileDocCategorySizeDatePackage
RequiredConfigNode.javaAPI DocGlassfish v2 API4787Fri May 04 22:31:40 BST 2007com.sun.enterprise.deployment.node.connector

RequiredConfigNode

public class RequiredConfigNode extends com.sun.enterprise.deployment.node.DeploymentDescriptorNode
This node is responsible for handling the Connector DTD related required-config-property XML tag
author
Sheetal Vartak
version

Fields Summary
private com.sun.enterprise.deployment.EnvironmentProperty
config
Constructors Summary
Methods Summary
public java.lang.ObjectgetDescriptor()

return
the descriptor instance to associate with this XMLNode

        if (config == null) {
            config = (EnvironmentProperty) DescriptorFactory.getDescriptor(getXMLPath());
        } 
        return config;
    
protected java.util.MapgetDispatchTable()
all sub-implementation of this class can use a dispatch table to map xml element to method name on the descriptor class for setting the element value.

return
the map with the element name as a key, the setter method as a value


                                                         
           
        Map table = super.getDispatchTable();
        table.put(ConnectorTagNames.CONFIG_PROPERTY_NAME, "setName");
	return table;
    
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


        if (! (descriptor instanceof MessageListener)) {
            throw new IllegalArgumentException(getClass() + " cannot handle descriptors of type " + descriptor.getClass());
        }
	Iterator configProps = null;
	if (descriptor instanceof MessageListener) {
	    configProps = ((MessageListener)descriptor).getConfigProperties().iterator();
	}

	//config property info
	for (;configProps.hasNext();) {
	    EnvironmentProperty config = (EnvironmentProperty) configProps.next();
	    Node configNode = appendChild(parent, ConnectorTagNames.REQUIRED_CONFIG_PROP);
            writeLocalizedDescriptions(configNode, config);
	    appendTextChild(configNode, ConnectorTagNames.CONFIG_PROPERTY_NAME, config.getName());  
	}
	return parent;