Top Description Fields Constructors Methods
org.apache.catalina.session

public abstract Class StoreBase

extends LifecycleBase
implements Store
Class Inheritance
All Implemented Interfaces
org.apache.catalina.Store
Known Direct Subclasses
org.apache.catalina.session.DataSourceStore, org.apache.catalina.session.FileStore
Imports
java.beans.PropertyChangeListener, .PropertyChangeSupport, java.io.BufferedInputStream, .IOException, .InputStream, .ObjectInputStream, org.apache.catalina.LifecycleException, .LifecycleState, .Manager, .Store, org.apache.catalina.util.CustomObjectInputStream, .LifecycleBase, .ToStringUtil, org.apache.tomcat.util.res.StringManager

Abstract implementation of the Store interface to support most of the functionality required by a Store.
Author
Bip Thelin

Field Summary

Modifier and TypeField and Description
protected Manager
manager

The Manager with which this Store is associated.

protected static final StringManager
sm

Hides org.apache.catalina.util.LifecycleBase.sm.

The string manager for this package.
protected static final String
storeName

Name to register for this Store, used for logging.

protected final PropertyChangeSupport
support

The property change support for this component.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addPropertyChangeListener(PropertyChangeListener
a value of type PropertyChangeListener
listener
)

Implements org.apache.catalina.Store.addPropertyChangeListener.

Add a property change listener to this component.

protected void
destroyInternal()

Implements abstract org.apache.catalina.util.LifecycleBase.destroyInternal.

Sub-classes implement this method to perform any instance destruction required.

public String[]

Returns:

list of session keys, that are to be expired
expiredKeys
()

Get only those keys of sessions, that are saved in the Store and are to be expired.

public Manager

Returns:

the Manager with which the Store is associated.
getManager
()

Implements org.apache.catalina.Store.getManager.

protected ObjectInputStream

Returns:

An appropriately configured ObjectInputStream from which the session can be read.
getObjectInputStream
(InputStream
The input stream provided by the sub-class that will provide the data for a session
is
)

Create the object input stream to use to read a session from the store.

public String

Returns:

the name for this Store, used for logging.
getStoreName
()

protected void
initInternal()

Implements abstract org.apache.catalina.util.LifecycleBase.initInternal.

Sub-classes implement this method to perform any instance initialisation required.

public void
processExpires()

Called by our background reaper thread to check if Sessions saved in our store are subject of being expired.

public void
removePropertyChangeListener(PropertyChangeListener
The listener to remove
listener
)

Implements org.apache.catalina.Store.removePropertyChangeListener.

Remove a property change listener from this component.

public void
setManager(Manager
The newly associated Manager
manager
)

Implements org.apache.catalina.Store.setManager.

Set the Manager with which this Store is associated.

protected void
startInternal()

Implements abstract org.apache.catalina.util.LifecycleBase.startInternal.

Start this component and implement the requirements of LifecycleBase#startInternal().

protected void
stopInternal()

Implements abstract org.apache.catalina.util.LifecycleBase.stopInternal.

Stop this component and implement the requirements of LifecycleBase#stopInternal().

public String

Returns:

a String rendering of this object.
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from org.apache.catalina.util.LifecycleBase:
addLifecycleListenerdestroyfindLifecycleListenersfireLifecycleEventgetStategetStateNamegetThrowOnFailureinitremoveLifecycleListenersetStatesetStatesetThrowOnFailurestartstop

Field Detail

managerback to summary
protected Manager manager

The Manager with which this Store is associated.

smback to summary
protected static final StringManager sm

Hides org.apache.catalina.util.LifecycleBase.sm.

The string manager for this package.

storeNameback to summary
protected static final String storeName

Name to register for this Store, used for logging.

supportback to summary
protected final PropertyChangeSupport support

The property change support for this component.

Constructor Detail

StoreBaseback to summary
public StoreBase()

Method Detail

addPropertyChangeListenerback to summary
public void addPropertyChangeListener(PropertyChangeListener listener)

Implements org.apache.catalina.Store.addPropertyChangeListener.

Add a property change listener to this component.

Parameters
listener:PropertyChangeListener

a value of type PropertyChangeListener

Annotations
@Override
destroyInternalback to summary
protected void destroyInternal()

Implements abstract org.apache.catalina.util.LifecycleBase.destroyInternal.

Doc from org.apache.catalina.util.LifecycleBase.destroyInternal.

Sub-classes implement this method to perform any instance destruction required.

Annotations
@Override
expiredKeysback to summary
public String[] expiredKeys() throws IOException

Get only those keys of sessions, that are saved in the Store and are to be expired.

Returns:String[]

list of session keys, that are to be expired

Exceptions
IOException:
if an input-/output error occurred
getManagerback to summary
public Manager getManager()

Implements org.apache.catalina.Store.getManager.

Returns:Manager

the Manager with which the Store is associated.

Annotations
@Override
getObjectInputStreamback to summary
protected ObjectInputStream getObjectInputStream(InputStream is) throws IOException

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:InputStream

The input stream provided by the sub-class that will provide the data for a session

Returns:ObjectInputStream

An appropriately configured ObjectInputStream from which the session can be read.

Exceptions
IOException:
if a problem occurs creating the ObjectInputStream
getStoreNameback to summary
public String getStoreName()
Returns:String

the name for this Store, used for logging.

initInternalback to summary
protected void initInternal()

Implements abstract org.apache.catalina.util.LifecycleBase.initInternal.

Doc from org.apache.catalina.util.LifecycleBase.initInternal.

Sub-classes implement this method to perform any instance initialisation required.

Annotations
@Override
processExpiresback to summary
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.

removePropertyChangeListenerback to summary
public void removePropertyChangeListener(PropertyChangeListener listener)

Implements org.apache.catalina.Store.removePropertyChangeListener.

Remove a property change listener from this component.

Parameters
listener:PropertyChangeListener

The listener to remove

Annotations
@Override
setManagerback to summary
public void setManager(Manager manager)

Implements org.apache.catalina.Store.setManager.

Set the Manager with which this Store is associated.

Parameters
manager:Manager

The newly associated Manager

Annotations
@Override
startInternalback to summary
protected void startInternal() throws LifecycleException

Implements abstract org.apache.catalina.util.LifecycleBase.startInternal.

Start this component and implement the requirements of LifecycleBase#startInternal().

Annotations
@Override
Exceptions
LifecycleException:
if this component detects a fatal error that prevents this component from being used
stopInternalback to summary
protected void stopInternal() throws LifecycleException

Implements abstract org.apache.catalina.util.LifecycleBase.stopInternal.

Stop this component and implement the requirements of LifecycleBase#stopInternal().

Annotations
@Override
Exceptions
LifecycleException:
if this component detects a fatal error that prevents this component from being used
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a String rendering of this object.

Annotations
@Override