public abstract class StoreBase extends Object implements Lifecycle, Store
Modifier and Type | Field and Description |
---|---|
protected int |
debug
The debugging detail level for this component.
|
protected String |
info
The descriptive information about this implementation.
|
protected LifecycleSupport |
lifecycle
The lifecycle event support for this component.
|
protected Manager |
manager
The Manager with which this JDBCStore is associated.
|
protected boolean |
started
Has this component been started yet?
|
protected String |
storeName
Name to register for this Store, used for logging.
|
protected PropertyChangeSupport |
support
The property change support for this component.
|
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, INIT_EVENT, START_EVENT, STOP_EVENT
Constructor and Description |
---|
StoreBase() |
Modifier and Type | Method and Description |
---|---|
void |
addLifecycleListener(LifecycleListener listener)
Add a lifecycle event listener to this component.
|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Add a property change listener to this component.
|
void |
doProcessExpires()
public wrapper for processExpires()
don't want to make processExpires() public
called from manager background thread
Hercules: added method
|
List<LifecycleListener> |
findLifecycleListeners()
Gets the (possibly empty) list of lifecycle listeners associated
with this Store.
|
int |
getDebug()
Return the debugging detail level for this Store.
|
String |
getInfo()
Return the info for this Store.
|
Manager |
getManager()
Return the Manager with which the Store is associated.
|
String |
getStoreName()
Return the name for this Store, used for logging.
|
Session |
load(String id,
String version)
Load and return the Session associated with the specified session
identifier from this Store, without removing it.
|
protected void |
log(String message)
Log a message on the Logger associated with our Container (if any).
|
void |
processExpires()
Called by our background reaper thread to check if Sessions
saved in our store are subject of being expired.
|
Session |
readSession(Manager manager,
ObjectInputStream ois)
Create a session object from an input stream.
|
void |
removeFromStoreCache(String id)
no-op method - sub classes will
implement to remove a session from the store
cache
Hercules: added method
|
void |
removeLifecycleListener(LifecycleListener listener)
Remove a lifecycle event listener from this component.
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
Remove a property change listener from this component.
|
void |
setDebug(int debug)
Set the debugging detail level for this Store.
|
void |
setManager(Manager manager)
Set the Manager with which this Store is associated.
|
void |
start()
Prepare for the beginning of active use of the public methods of this
component.
|
void |
stop()
Gracefully terminate the active use of the public methods of this
component.
|
void |
writeSession(Session sess,
ObjectOutputStream oos)
Serialize a session into an output stream.
|
protected String info
protected String storeName
protected int debug
protected boolean started
protected LifecycleSupport lifecycle
protected PropertyChangeSupport support
protected Manager manager
public String getInfo()
public String getStoreName()
public void setDebug(int debug)
debug
- The new debugging detail levelpublic int getDebug()
public void setManager(Manager manager)
setManager
in interface Store
manager
- The newly associated Managerpublic Manager getManager()
getManager
in interface Store
public void addLifecycleListener(LifecycleListener listener)
addLifecycleListener
in interface Lifecycle
listener
- The listener to addpublic List<LifecycleListener> findLifecycleListeners()
findLifecycleListeners
in interface Lifecycle
public void removeLifecycleListener(LifecycleListener listener)
removeLifecycleListener
in interface Lifecycle
listener
- The listener to addpublic void addPropertyChangeListener(PropertyChangeListener listener)
addPropertyChangeListener
in interface Store
listener
- a value of type 'PropertyChangeListener'public void removePropertyChangeListener(PropertyChangeListener listener)
removePropertyChangeListener
in interface Store
listener
- The listener to removepublic void writeSession(Session sess, ObjectOutputStream oos) throws IOException
sess
- The session to be serializedoos
- The output stream the session should be written to
Hercules: added methodIOException
public Session readSession(Manager manager, ObjectInputStream ois) throws ClassNotFoundException, IOException
manager
- The manager that will own this sessionois
- The input stream containing the serialized sessionClassNotFoundException
IOException
public void doProcessExpires()
public void removeFromStoreCache(String id)
public void processExpires()
protected void log(String message)
message
- Message to be loggedpublic Session load(String id, String version) throws ClassNotFoundException, IOException
null
.id
- Session identifier of the session to loadversion
- The requested session versionClassNotFoundException
- if a deserialization error occursIOException
- if an input/output error occurspublic void start() throws LifecycleException
configure()
,
and before any of the public methods of the component are utilized.start
in interface Lifecycle
LifecycleException
- if this component detects a fatal error
that prevents this component from being usedpublic void stop() throws LifecycleException
stop
in interface Lifecycle
LifecycleException
- if this component detects a fatal error
that needs to be reportedCopyright © 2021. All rights reserved.