org.apache.tomcat.modules.session
Class SimpleSessionStore
java.lang.Object
|
+--org.apache.tomcat.core.BaseInterceptor
|
+--org.apache.tomcat.modules.session.SimpleSessionStore
- public final class SimpleSessionStore
- extends BaseInterceptor
A simple session store plugin. It will create, store and maintain
session objects using a simple in-memory pool.
It must be inserted after SessionId, which does common
session stuff ( cookie, rewrite, etc)
- Author:
- costin@eng.sun.com, hans@gefionsoftware.com, pfrieden@dChain.com, Shai Fultheim [shai@brm.com]
Methods inherited from class org.apache.tomcat.core.BaseInterceptor |
addContainer, addContext, addHandler, addInterceptor, addSecurityConstraint, afterBody, authenticate, authorize, beforeBody, beforeCommit, contextMap, contextState, engineShutdown, engineStart, engineState, engineStop, getContext, getContextManager, getDebug, getInfo, getLog, getNote, getNote, handleError, log, log, log, log, postReadRequest, postRequest, postService, postServletDestroy, postServletInit, preService, preServletDestroy, preServletInit, registerHooks, removeContainer, removeContext, removeHandler, removeInterceptor, requestMap, setContext, setContextManager, setDebug, setInfo, setNote, setNote |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleSessionStore
public SimpleSessionStore()
setMaxActiveSessions
public void setMaxActiveSessions(int count)
setInitialPool
public void setInitialPool(int initial)
setMaxPool
public void setMaxPool(int max)
engineInit
public void engineInit(ContextManager cm)
throws TomcatException
- Description copied from class:
BaseInterceptor
- Initialize the module.
- Overrides:
engineInit
in class BaseInterceptor
- Following copied from class:
org.apache.tomcat.core.BaseInterceptor
- Throws:
TomcatException
- The module will not be added if any
exception is thrown by engineInit.
reload
public void reload(Request req,
Context ctx)
throws TomcatException
- Description copied from class:
BaseInterceptor
- Reload notification - called whenever a reload is done.
This can be used to serialize sessions, log the event,
remove any resource that was class-loader dependent.
Note. The current implementation uses a note "oldLoader"
that will keep a reference to the previous class loader
during this hook. It will be set by the module that creates
the loaders, and should be destroyed when the hook is done.
This can also be implemented using a get/setOldClassLoader
in Context, but so far this is used in only 2 modules, adding
new API is not needed.
- Overrides:
reload
in class BaseInterceptor
findSession
public ServerSession findSession(Request request,
java.lang.String sessionId,
boolean create)
- The session store hook
- Overrides:
findSession
in class BaseInterceptor
- Following copied from class:
org.apache.tomcat.core.BaseInterceptor
- Parameters:
reqSessionId
- if null the manager will generate the id
contextInit
public void contextInit(Context ctx)
throws TomcatException
- Init session management stuff for this context.
- Overrides:
contextInit
in class BaseInterceptor
- Following copied from class:
org.apache.tomcat.core.BaseInterceptor
- Throws:
If
- the interceptor throws exception the context will
not be initialized ( state==NEW or ADDED or DISABLED ).
contextShutdown
public void contextShutdown(Context ctx)
throws TomcatException
- Notification of context shutdown.
We should clean up any resources that are used by our
session management code.
- Overrides:
contextShutdown
in class BaseInterceptor
sessionState
public int sessionState(Request req,
ServerSession session,
int state)
- Description copied from class:
BaseInterceptor
- Hook for session state changes.
Will be called every time a session change it's state.
A session module will announce all changes - like STATE_NEW when
the session is created, STATE_EXPIRED when the session is expired,
STATE_INVALID when the session is invalidated.
- Overrides:
sessionState
in class BaseInterceptor
getSessionIds
public java.util.Enumeration getSessionIds(Context ctx)
getSessions
public java.util.Enumeration getSessions(Context ctx)
getSessionCount
public int getSessionCount(Context ctx)
getRecycledCount
public int getRecycledCount(Context ctx)
findSession
public ServerSession findSession(Context ctx,
java.lang.String sessionId)
Copyright © 2001 Apache Software Foundation. All Rights Reserved.