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

SessionManagerNode

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

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

	
        registerElementHandler(new XMLElement(RuntimeTagNames.MANAGER_PROPERTIES), 
                               WebPropertyContainerNode.class, "setManagerProperties");	
        registerElementHandler(new XMLElement(RuntimeTagNames.STORE_PROPERTIES), 
                               WebPropertyContainerNode.class, "setStoreProperties");				       
    
Methods Summary
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

	RuntimeDescriptor descriptor = getRuntimeDescriptor();
	if (descriptor==null) {
	    throw new RuntimeException("Trying to set values on a null descriptor");
	}
	if (element.getQName().equals(RuntimeTagNames.PERSISTENCE_TYPE)) {
	    descriptor.setAttributeValue(SessionManager.PERSISTENCE_TYPE, value);
	}
    
public org.w3c.dom.NodewriteDescriptor(org.w3c.dom.Node parent, java.lang.String nodeName, com.sun.enterprise.deployment.runtime.web.SessionManager 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

	
	Element sessionMgr = (Element) super.writeDescriptor(parent, nodeName, descriptor);
	
	// manager-properties?
	if (descriptor.getManagerProperties()!=null) {
	    WebPropertyNode wpn = new WebPropertyNode();
	    Node mgrProps = appendChild(sessionMgr, RuntimeTagNames.MANAGER_PROPERTIES);
	    wpn.writeDescriptor(mgrProps, RuntimeTagNames.PROPERTY, descriptor.getManagerProperties().getWebProperty());
	}
	
	// store-properties?
	if (descriptor.getStoreProperties()!=null) {
	    WebPropertyNode wpn = new WebPropertyNode();
	    Node storeProps = appendChild(sessionMgr, RuntimeTagNames.STORE_PROPERTIES);
	    wpn.writeDescriptor(storeProps, RuntimeTagNames.PROPERTY, descriptor.getStoreProperties().getWebProperty());
	}
	
	// persistence-type?
	setAttribute(sessionMgr, RuntimeTagNames.PERSISTENCE_TYPE, (String) descriptor.getAttributeValue(SessionManager.PERSISTENCE_TYPE));
	
	return sessionMgr;