public class PropertiesCacheManager extends CacheManager implements Handler, java.io.Serializable
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:
Modifier and Type | Class and Description |
---|---|
static interface |
PropertiesCacheManager.Saveable
This interface allows for persistence of non-properties session objects.
|
sessions
Constructor and Description |
---|
PropertiesCacheManager() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
getObj(java.lang.Object session,
java.lang.Object ident)
If we have deferred session loading, check here and get it!
|
boolean |
init(Server server,
java.lang.String prefix)
Install this class as the session manager.
|
boolean |
respond(Request request)
Don't handle any URL requests (yet)
|
flush, makeKey, putObj, putObj, removeObj
get, getSession, put, remove, setSessionManager
public boolean init(Server server, java.lang.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
.protected java.lang.Object getObj(java.lang.Object session, java.lang.Object ident)
getObj
in class CacheManager