dlr 02/01/17 18:24:59
Modified: src/java/org/apache/stratum/jcs/utils/servlet/session
DistSession.java
Log:
Achieved 2.3 Servlet API compatibility.
o Added DistSession(ServletContext) constructor, which should be used
in the future.
o Added getServletContext() accessor method.
Revision Changes Path
1.5 +38 -6
jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/servlet/session/DistSession.java
Index: DistSession.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/servlet/session/DistSession.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -u -r1.4 -r1.5
--- DistSession.java 16 Jan 2002 17:04:47 -0000 1.4
+++ DistSession.java 18 Jan 2002 02:24:58 -0000 1.5
@@ -5,6 +5,7 @@
import java.util.Enumeration;
import java.util.Set;
+import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionBindingEvent;
import javax.servlet.http.HttpSessionBindingListener;
@@ -19,17 +20,21 @@
////////////////////////////////////////////////////////////////
/**
- * DistSession uses the CompositeCache and GroupCache to create a failover-safe
- * distributed session.
+ * DistSession uses the CompositeCache and GroupCache to create a
+ * failover-safe distributed session.
*
*@author asmuts
+ *@author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a>
*@created January 15, 2002
*/
-public class DistSession implements HttpSession, ICleanForPool, ISessionConstants
+public class DistSession
+ implements HttpSession, ICleanForPool, ISessionConstants
{
private static boolean SET_ATTR_INVOCATION = true;
private static boolean REMOVE_ATTR_INVOCATION = false;
+ private ServletContext context;
+
private String session_id;
private SessionInfo sessInfo;
@@ -42,17 +47,33 @@
///////////////////////////////////////////////
/**
- * Constructor for the DistSession object
+ * Constructor for a new instance with no
+ * <code>ServletContext</code>.
+ *
+ * This method will eventually be deprecated in favor of
+ * DistSession(ServletContext).
*/
public DistSession()
{
+ this(null);
+ }
+
+
+ /**
+ * Creates a new instance with the specified
+ * <code>ServletContext</code>.
+ */
+ public DistSession(ServletContext context)
+ {
+ this.context = context;
log = LoggerManager.getLogger( this );
try
{
sessCache = GroupCacheAccess.getGroupAccess( SESS_CACHE_NAME );
}
catch ( Exception e )
- {}
+ {
+ }
}
@@ -108,11 +129,22 @@
/////////////////////////////////////////////
/**
- * Description of the Method
+ * Clears the session information.
*/
public void clean()
{
sessInfo = null;
+ }
+
+
+ /////////////////////////////////////////////
+ /**
+ * Returns a reference to the <code>ServletContext</code> this
+ * session is a part of.
+ */
+ public ServletContext getServletContext()
+ {
+ return context;
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>