1 18 package org.apache.beehive.netui.pageflow.scoping.internal; 19 20 import javax.servlet.http.HttpSession ; 21 import javax.servlet.http.HttpSessionContext ; 22 import javax.servlet.ServletContext ; 23 import java.io.Serializable ; 24 25 26 31 public class ScopedSession 32 extends ScopedAttributeContainer 33 implements HttpSession , Serializable 34 { 35 private transient HttpSession _session; 36 private transient ServletContext _servletContext; 37 38 41 public ScopedSession() 42 { 43 super( null ); 44 } 45 46 public ScopedSession( HttpSession session, ServletContext cxt, Object scopeKey ) 47 { 48 super( scopeKey ); 49 _session = session; 50 _servletContext = cxt; 51 } 52 53 public long getCreationTime() 54 { 55 return _session.getCreationTime(); 56 } 57 58 public String getId() 59 { 60 return getScopedName( _session.getId() ); 61 } 62 63 public long getLastAccessedTime() 64 { 65 return _session.getLastAccessedTime(); 66 } 67 68 public ServletContext getServletContext() 69 { 70 return _servletContext; 71 } 72 73 public void setMaxInactiveInterval( int i ) 74 { 75 _session.setMaxInactiveInterval( i ); 76 } 77 78 public int getMaxInactiveInterval() 79 { 80 return _session.getMaxInactiveInterval(); 81 } 82 83 public HttpSessionContext getSessionContext() 84 { 85 return _session.getSessionContext(); 86 } 87 88 public Object getValue( String s ) 89 { 90 return getAttribute( s ); 91 } 92 93 public String [] getValueNames() 94 { 95 return getAttributeNamesArray(); 96 } 97 98 public void putValue( String s, Object o ) 99 { 100 setAttribute( s, o ); 101 } 102 103 public void removeValue( String s ) 104 { 105 removeAttribute( s ); 106 } 107 108 public void invalidate() 109 { 110 removeAllAttributes(); 111 } 112 113 public boolean isNew() 114 { 115 return _session.isNew(); 116 } 117 118 122 void setSession( HttpSession session, ServletContext cxt ) 123 { 124 _session = session; 125 _servletContext = cxt; 126 } 127 128 131 public HttpSession getOuterSession() 132 { 133 return _session; 134 } 135 } 136 | Popular Tags |