org.mortbay.jetty.servlet
Class AbstractSessionManager

java.lang.Object
  |
  +--org.mortbay.jetty.servlet.AbstractSessionManager
All Implemented Interfaces:
LifeCycle, java.io.Serializable, SessionManager
Direct Known Subclasses:
HashSessionManager

public abstract class AbstractSessionManager
extends java.lang.Object
implements SessionManager

An Abstract implementation of SessionManager. The partial implementation of SessionManager interface provides the majority of the handling required to implement a SessionManager. Concrete implementations of SessionManager based on AbstractSessionManager need only implement the newSession method to return a specialized version of the Session inner class that provides an attribute Map.

Version:
$Id: AbstractSessionManager.java,v 1.22 2003/01/14 10:18:28 gregwilkins Exp $
Author:
Greg Wilkins (gregw)
See Also:
Serialized Form

Nested Class Summary
 class AbstractSessionManager.Session
           
 
Nested classes inherited from class org.mortbay.jetty.servlet.SessionManager
 
Field Summary
static int __distantFuture
           
 
Fields inherited from interface org.mortbay.jetty.servlet.SessionManager
__MaxAge, __SessionCookie, __SessionDomain, __SessionPath, __SessionURL, __SessionUrlPrefix
 
Constructor Summary
AbstractSessionManager()
           
AbstractSessionManager(java.util.Random random)
           
 
Method Summary
 void addEventListener(java.util.EventListener listener)
          Add an event listener.
 HttpSession getHttpSession(java.lang.String id)
           
 java.util.Map getSessionMap()
           
 java.lang.String getWorkerName()
          Get the workname.
 void initialize(ServletHandler handler)
           
 boolean isStarted()
           
 HttpSession newHttpSession(HttpServletRequest request)
           
 void removeEventListener(java.util.EventListener listener)
           
 void setMaxInactiveInterval(int seconds)
           
 void setScavangePeriod(int seconds)
           
 void setWorkerName(java.lang.String workerName)
          Set the workname.
 void start()
          Start the LifeCycle.
 void stop()
          Stop the LifeCycle.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__distantFuture

public static final int __distantFuture
See Also:
Constant Field Values
Constructor Detail

AbstractSessionManager

public AbstractSessionManager()

AbstractSessionManager

public AbstractSessionManager(java.util.Random random)
Method Detail

initialize

public void initialize(ServletHandler handler)
Specified by:
initialize in interface SessionManager

getSessionMap

public java.util.Map getSessionMap()

getHttpSession

public HttpSession getHttpSession(java.lang.String id)
Specified by:
getHttpSession in interface SessionManager

newHttpSession

public HttpSession newHttpSession(HttpServletRequest request)
Specified by:
newHttpSession in interface SessionManager

getWorkerName

public java.lang.String getWorkerName()
Get the workname. If set, the workername is dot appended to the session ID and can be used to assist session affinity in a load balancer.

Returns:
String or null

setWorkerName

public void setWorkerName(java.lang.String workerName)
Set the workname. If set, the workername is dot appended to the session ID and can be used to assist session affinity in a load balancer.

Parameters:
workerName -

setMaxInactiveInterval

public void setMaxInactiveInterval(int seconds)
Specified by:
setMaxInactiveInterval in interface SessionManager
Parameters:
seconds -

setScavangePeriod

public void setScavangePeriod(int seconds)
Parameters:
seconds -

addEventListener

public void addEventListener(java.util.EventListener listener)
                      throws java.lang.IllegalArgumentException
Description copied from interface: SessionManager
Add an event listener.

Specified by:
addEventListener in interface SessionManager
Parameters:
listener - An Event Listener. Individual SessionManagers implemetations may accept arbitrary listener types, but they are expected to at least handle HttpSessionActivationListener, HttpSessionAttributeListener, HttpSessionBindingListener, HttpSessionListener
Throws:
java.lang.IllegalArgumentException - If an unsupported listener is passed.

removeEventListener

public void removeEventListener(java.util.EventListener listener)
Specified by:
removeEventListener in interface SessionManager

isStarted

public boolean isStarted()
Specified by:
isStarted in interface LifeCycle
Returns:
True if the LifeCycle has been started.

start

public void start()
           throws java.lang.Exception
Description copied from interface: LifeCycle
Start the LifeCycle.

Specified by:
start in interface LifeCycle
Throws:
java.lang.Exception - An arbitrary exception may be thrown.

stop

public void stop()
Description copied from interface: LifeCycle
Stop the LifeCycle. The LifeCycle may wait for current activities to complete normally, but it can be interrupted.

Specified by:
stop in interface LifeCycle


Copyright ? 2000 Mortbay Consulting Pty. Ltd. All Rights Reserved.