sunlabs.brazil.session
public class CacheManager extends SessionManager implements Handler
SessionManager
associates an object with a Session ID
to give Handlers the ability to maintain state that lasts for the
duration of a session instead of just for the duration of a request.
It should be installed as a handler, whoses init method will replace
the default session manager.
This version maintains a pool of hashtables. Once they all fill up - one of them gets tossed, causing any session info in it to be lost. It uses a simplified approximate LRU scheme. The default session manager doesn't loose any session information, but grows the heap without bound as the number of sessions increase.
properties:
Version: %V% CacheManager.java
Method Summary | |
---|---|
protected void | flush()
The active hashtable is too big, find the hashtable
with the worst Score, clear it, and set it as the active table. |
protected Object | getObj(Object session, Object ident) |
boolean | init(Server server, String prefix)
Install this class as the session manager.
|
protected String | makeKey(Object session, Object ident)
Invent a single key from the 2 separate ones |
protected void | putObj(String key, Object value) |
protected void | putObj(Object session, Object ident, Object value) |
void | removeObj(Object session, Object ident)
Remove an object from a session table.
|
boolean | respond(Request request)
Don't handle any URL requests (yet) |