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

AdminObjectNode

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

Fields Summary
private com.sun.enterprise.deployment.AdminObject
adminObject
Constructors Summary
public AdminObjectNode()

    
      
	register();
    
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) {
	    adminObject.addConfigProperty((EnvironmentProperty)obj);
	}
    
public java.lang.ObjectgetDescriptor()

return
the descriptor instance to associate with this XMLNode

        if (adminObject == null) {
            adminObject = (AdminObject) DescriptorFactory.getDescriptor(getXMLPath());
        } 
        return adminObject;
    
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.ADMIN_OBJECT_INTERFACE, "setAdminObjectInterface");
        table.put(ConnectorTagNames.ADMIN_OBJECT_CLASS, "setAdminObjectClass");
        return table;
    
private voidregister()
method for registering the handlers with the various tags

	registerElementHandler(new XMLElement(ConnectorTagNames.CONFIG_PROPERTY),
			       ConfigPropertyNode.class); 
    
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 ConnectorDescriptor)) {
            throw new IllegalArgumentException(getClass() + " cannot handle descriptors of type " + descriptor.getClass());
        }

	//adminObject info
	for (Iterator adminObjects = ((ConnectorDescriptor)descriptor).getAdminObjects().iterator(); adminObjects.hasNext();) {
	    AdminObject adminObject = (AdminObject) adminObjects.next();
	    Node adminObjectNode = appendChild(parent, ConnectorTagNames.ADMIN_OBJECT);
	    appendTextChild(adminObjectNode, ConnectorTagNames.ADMIN_OBJECT_INTERFACE, adminObject.getAdminObjectInterface());   
	    appendTextChild(adminObjectNode, ConnectorTagNames.ADMIN_OBJECT_CLASS, adminObject.getAdminObjectClass());  

	    ConfigPropertyNode config = new ConfigPropertyNode();
	    adminObjectNode = config.writeDescriptor(adminObjectNode, adminObject);
	}

	return parent;