|
![]() |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsunlabs.brazil.session.SessionManager
sunlabs.brazil.session.CacheManager
sunlabs.brazil.session.PropertiesCacheManager (view source)
public class PropertiesCacheManager
A version of the CacheManager that saves out any session state that is either a "java properties" object, or implements "Saveable" into a directory in the filesystem, one file per entry, then restores them on server startup. This is a "poor man's" serialization, that saves only ascii state represented in properties files. This permits a wider variety of changes to be made to the server code, yet still have the ability to read in the proper session information.
Classes that are not properties files may implement "Saveable", which has the store() and load() methods from Properties; they are expected to generate and restore the state of the object in Properties format.
This handler/sessionManager can take an ascii-readable "snapshot" of the server state, for all state that is a java properties object (or implements Saveable). It doesn't perturb the existing state.
Properties:
Nested Class Summary | |
---|---|
static interface |
PropertiesCacheManager.Saveable
This interface allows for persistence of non-properties session objects. |
Constructor Summary | |
---|---|
PropertiesCacheManager()
|
Method Summary | |
---|---|
boolean |
init(Server server,
String prefix)
Install this class as the session manager. |
boolean |
respond(Request request)
Don't handle any URL requests (yet) |
Methods inherited from class sunlabs.brazil.session.CacheManager |
---|
removeObj |
Methods inherited from class sunlabs.brazil.session.SessionManager |
---|
get, getSession, put, remove, setSessionManager |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PropertiesCacheManager()
Method Detail |
---|
public boolean init(Server server, String prefix)
CacheManager
init
in interface Handler
init
in class CacheManager
server
- The HTTP server that created this Handler
.
Typical Handler
s will use Server.props
to obtain run-time configuration information.prefix
- The handlers name.
The string this Handler
may prepend to all
of the keys that it uses to extract configuration information
from Server.props
. This is set (by the Server
and ChainHandler
) to help avoid configuration parameter
namespace collisions.
true
if this Handler
initialized
successfully, false
otherwise. If
false
is returned, this Handler
should not be used.public boolean respond(Request request)
CacheManager
respond
in interface Handler
respond
in class CacheManager
request
- The Request
object that represents the HTTP
request.
true
if the request was handled. A request was
handled if a response was supplied to the client, typically
by calling Request.sendResponse()
or
Request.sendError
.
|
Version Kenai-svn-r24, Generated 08/18/09 Copyright (c) 2001-2009, Sun Microsystems. |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |