1 23 24 package com.sun.enterprise.deployment.node.runtime.web; 25 26 import org.w3c.dom.Node ; 27 28 import com.sun.enterprise.deployment.node.XMLElement; 29 import com.sun.enterprise.deployment.runtime.web.SessionConfig; 30 import com.sun.enterprise.deployment.xml.RuntimeTagNames; 31 32 37 38 public class SessionConfigNode extends WebRuntimeNode { 39 40 43 public SessionConfigNode() { 44 45 registerElementHandler(new XMLElement(RuntimeTagNames.SESSION_MANAGER), 46 SessionManagerNode.class, "setSessionManager"); 47 registerElementHandler(new XMLElement(RuntimeTagNames.SESSION_PROPERTIES), 48 WebPropertyContainerNode.class, "setSessionProperties"); 49 registerElementHandler(new XMLElement(RuntimeTagNames.COOKIE_PROPERTIES), 50 WebPropertyContainerNode.class, "setCookieProperties"); 51 } 52 53 61 public Node writeDescriptor(Node parent, String nodeName, SessionConfig descriptor) { 62 Node sessionConfig = super.writeDescriptor(parent, nodeName, descriptor); 63 64 if (descriptor.getSessionManager()!=null) { 66 SessionManagerNode smn = new SessionManagerNode(); 67 smn.writeDescriptor(sessionConfig, RuntimeTagNames.SESSION_MANAGER, descriptor.getSessionManager()); 68 } 69 70 if (descriptor.getSessionProperties()!=null) { 72 WebPropertyNode wpn = new WebPropertyNode(); 73 Node sessionProps = appendChild(sessionConfig, RuntimeTagNames.SESSION_PROPERTIES); 74 wpn.writeDescriptor(sessionProps, RuntimeTagNames.PROPERTY, descriptor.getSessionProperties().getWebProperty()); 75 } 76 77 if (descriptor.getCookieProperties()!=null) { 79 WebPropertyNode wpn = new WebPropertyNode(); 80 Node cookieProps = appendChild(sessionConfig, RuntimeTagNames.COOKIE_PROPERTIES); 81 wpn.writeDescriptor(cookieProps, RuntimeTagNames.PROPERTY, descriptor.getCookieProperties().getWebProperty()); 82 } 83 84 return sessionConfig; 85 } 86 } 87 | Popular Tags |