FileDocCategorySizeDatePackage
SessionConfigNode.javaAPI DocGlassfish v2 API4280Fri May 04 22:31:48 BST 2007com.sun.enterprise.deployment.node.runtime.web

SessionConfigNode

public class SessionConfigNode extends WebRuntimeNode
superclass node for WebProperty container
author
Jerome Dochez

Fields Summary
Constructors Summary
public SessionConfigNode()
Initialize the child handlers

	
        registerElementHandler(new XMLElement(RuntimeTagNames.SESSION_MANAGER), 
                               SessionManagerNode.class, "setSessionManager");	
        registerElementHandler(new XMLElement(RuntimeTagNames.SESSION_PROPERTIES), 
                               WebPropertyContainerNode.class, "setSessionProperties");	
        registerElementHandler(new XMLElement(RuntimeTagNames.COOKIE_PROPERTIES), 
                               WebPropertyContainerNode.class, "setCookieProperties");				       
    
Methods Summary
public org.w3c.dom.NodewriteDescriptor(org.w3c.dom.Node parent, java.lang.String nodeName, com.sun.enterprise.deployment.runtime.web.SessionConfig descriptor)
write the descriptor class to a DOM tree and return it

param
parent node for the DOM tree
param
node name
param
the descriptor to write
return
the DOM tree top node

	Node sessionConfig = super.writeDescriptor(parent, nodeName, descriptor);

	// session-manager?
	if (descriptor.getSessionManager()!=null) {
	    SessionManagerNode smn = new SessionManagerNode();
	    smn.writeDescriptor(sessionConfig, RuntimeTagNames.SESSION_MANAGER, descriptor.getSessionManager());
	}
	
	// session-properties?
	if (descriptor.getSessionProperties()!=null) {
	    WebPropertyNode wpn = new WebPropertyNode();
	    Node sessionProps = appendChild(sessionConfig, RuntimeTagNames.SESSION_PROPERTIES);
	    wpn.writeDescriptor(sessionProps, RuntimeTagNames.PROPERTY, descriptor.getSessionProperties().getWebProperty());
	}
	
	// cookie-properties?
	if (descriptor.getCookieProperties()!=null) {
	    WebPropertyNode wpn = new WebPropertyNode();
	    Node cookieProps = appendChild(sessionConfig, RuntimeTagNames.COOKIE_PROPERTIES);
	    wpn.writeDescriptor(cookieProps, RuntimeTagNames.PROPERTY, descriptor.getCookieProperties().getWebProperty());
	}
	
	return sessionConfig;