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

ActivationSpecNode

public class ActivationSpecNode extends com.sun.enterprise.deployment.node.DeploymentDescriptorNode
This node is responsible for handling the Connector DTD related activationspec XML tag
author
Sheetal Vartak
version

Fields Summary
private com.sun.enterprise.deployment.MessageListener
msgListener
Constructors Summary
public ActivationSpecNode()

    
      
	registerElementHandler(new XMLElement(ConnectorTagNames.REQUIRED_CONFIG_PROP),
			       RequiredConfigNode.class); 
	
    
Methods Summary
public voidaddDescriptor(java.lang.Object obj)
Adds a new DOL descriptor instance to the descriptor instance associated with this XMLNode

param
descriptor the new descriptor

	if (obj instanceof EnvironmentProperty) {
	    msgListener.addConfigProperty((EnvironmentProperty)obj);
	}
    
public java.lang.ObjectgetDescriptor()

return
the descriptor instance to associate with this XMLNode

        if (msgListener == null) {
            msgListener = (MessageListener) getParentNode().getDescriptor();
        } 
        return msgListener;
    
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.ACTIVATION_SPEC_CLASS, "setActivationSpecClass");
        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());
        }

	MessageListener msgListener = (MessageListener)descriptor;
	Node actSpecNode = appendChild(parent, ConnectorTagNames.ACTIVATION_SPEC);
	appendTextChild(actSpecNode, ConnectorTagNames.ACTIVATION_SPEC_CLASS, msgListener.getActivationSpecClass());

	//required-config-property
	RequiredConfigNode reqNode = new RequiredConfigNode();
	actSpecNode = reqNode.writeDescriptor(actSpecNode, msgListener);
	
	return parent;