FileDocCategorySizeDatePackage
DefaultResourcePrincipalNode.javaAPI DocGlassfish v2 API4345Fri May 04 22:31:42 BST 2007com.sun.enterprise.deployment.node.runtime

DefaultResourcePrincipalNode

public class DefaultResourcePrincipalNode extends com.sun.enterprise.deployment.node.DeploymentDescriptorNode
This node handles the runtime deployment descriptor tag default-resource-principal
author
Jerome Dochez
version

Fields Summary
private String
name
private String
passwd
Constructors Summary
Methods Summary
public java.lang.ObjectgetDescriptor()

return
the descriptor instance to associate with this XMLNode


                    
       
        return null;
    
public voidpostParsing()
notification of the end of XML parsing for this node

   
        if (getParentNode().getDescriptor() instanceof ResourceReferenceDescriptor) {
            ((ResourceReferenceDescriptor) getParentNode().getDescriptor()).setResourcePrincipal(new ResourcePrincipal(name, passwd));
        } else {
            getParentNode().addDescriptor(new ResourcePrincipal(name, passwd));
        }
    
public voidsetElementValue(com.sun.enterprise.deployment.node.XMLElement element, java.lang.String value)
receives notification of the value for a particular tag

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

        if (RuntimeTagNames.NAME.equals(element.getQName())) {
            name = value;
        } else  if (RuntimeTagNames.PASSWORD.equals(element.getQName())) {
            passwd = value;
        } else super.setElementValue(element, value);
    
public org.w3c.dom.NodewriteDescriptor(org.w3c.dom.Node parent, java.lang.String nodeName, com.sun.enterprise.deployment.ResourcePrincipal rpDescriptor)
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

     
        Node principalNode = super.writeDescriptor(parent, nodeName, null);
        appendTextChild(principalNode, RuntimeTagNames.NAME, rpDescriptor.getName());
	appendTextChild(principalNode, RuntimeTagNames.PASSWORD, rpDescriptor.getPassword()); 
        return principalNode;