Package org.apache.catalina.session
Class StoreBase
java.lang.Object
org.apache.catalina.util.LifecycleBase
org.apache.catalina.session.StoreBase
- Direct Known Subclasses:
DataSourceStore
,FileStore
Abstract implementation of the
Store
interface to support most of the functionality required by a
Store
.- Author:
- Bip Thelin
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.catalina.Lifecycle
Lifecycle.SingleUse
-
Field Summary
Modifier and TypeFieldDescriptionprotected Manager
The Manager with which this Store is associated.protected static final StringManager
The string manager for this package.protected static final String
Name to register for this Store, used for logging.protected final PropertyChangeSupport
The property change support for this component.Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a property change listener to this component.protected void
Sub-classes implement this method to perform any instance destruction required.String[]
Get only those keys of sessions, that are saved in the Store and are to be expired.protected ObjectInputStream
Create the object input stream to use to read a session from the store.protected void
Sub-classes implement this method to perform any instance initialisation required.void
Called by our background reaper thread to check if Sessions saved in our store are subject of being expired.void
Remove a property change listener from this component.void
setManager
(Manager manager) Set the Manager associated with this Store.protected void
Start this component and implement the requirements ofLifecycleBase.startInternal()
.protected void
Stop this component and implement the requirements ofLifecycleBase.stopInternal()
.toString()
Methods inherited from class org.apache.catalina.util.LifecycleBase
addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stop
-
Field Details
-
storeName
Name to register for this Store, used for logging.- See Also:
-
support
The property change support for this component. -
sm
The string manager for this package. -
manager
The Manager with which this Store is associated.
-
-
Constructor Details
-
StoreBase
public StoreBase()
-
-
Method Details
-
getStoreName
- Returns:
- the name for this Store, used for logging.
-
setManager
Description copied from interface:Store
Set the Manager associated with this Store.- Specified by:
setManager
in interfaceStore
- Parameters:
manager
- The Manager which will use this Store.
-
getManager
- Specified by:
getManager
in interfaceStore
- Returns:
- the Manager instance associated with this Store.
-
addPropertyChangeListener
Description copied from interface:Store
Add a property change listener to this component.- Specified by:
addPropertyChangeListener
in interfaceStore
- Parameters:
listener
- The listener to add
-
removePropertyChangeListener
Description copied from interface:Store
Remove a property change listener from this component.- Specified by:
removePropertyChangeListener
in interfaceStore
- Parameters:
listener
- The listener to remove
-
expiredKeys
Get only those keys of sessions, that are saved in the Store and are to be expired.- Returns:
- list of session keys, that are to be expired
- Throws:
IOException
- if an input-/output error occurred
-
processExpires
public void processExpires()Called by our background reaper thread to check if Sessions saved in our store are subject of being expired. If so expire the Session and remove it from the Store. -
getObjectInputStream
Create the object input stream to use to read a session from the store. Sub-classes must have set the thread context class loader before calling this method.- Parameters:
is
- The input stream provided by the sub-class that will provide the data for a session- Returns:
- An appropriately configured ObjectInputStream from which the session can be read.
- Throws:
IOException
- if a problem occurs creating the ObjectInputStream
-
initInternal
protected void initInternal()Description copied from class:LifecycleBase
Sub-classes implement this method to perform any instance initialisation required.- Specified by:
initInternal
in classLifecycleBase
-
startInternal
Start this component and implement the requirements ofLifecycleBase.startInternal()
.- Specified by:
startInternal
in classLifecycleBase
- Throws:
LifecycleException
- if this component detects a fatal error that prevents this component from being used
-
stopInternal
Stop this component and implement the requirements ofLifecycleBase.stopInternal()
.- Specified by:
stopInternal
in classLifecycleBase
- Throws:
LifecycleException
- if this component detects a fatal error that prevents this component from being used
-
destroyInternal
protected void destroyInternal()Description copied from class:LifecycleBase
Sub-classes implement this method to perform any instance destruction required.- Specified by:
destroyInternal
in classLifecycleBase
-
toString
-