The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Wombat::SessionManager::SessionManagerBase - session manager base class

SYNOPSIS

DESCRIPTION

Minimal base implementation of Wombat::SessionManager. This class supports no session persistence or distributable capabilities. This class may be subclassed to create more sophisticated Manager implementations. Subclasses MUST override add(), getName(), getSession(), getSessions(), and remove().

CONSTRUCTOR

new()

Construct and return a Wombat::SessionManager::SessionManagerBase instance, initializing fields appropriately. If subclasses override the constructor, they must be sure to call

  $self->SUPER::new();

ACCESSOR METHODS

getContainer()

Return the Container for which this SessionManager manages Sessions.

setContainer($container)

Set the Container for which this SessionManager manages Sessions.

Parameters:

$container

the Wombat::Container

getMaxInactiveInterval()

Return the default maximum inactive interval in seconds for Sessions created by this SessionManager.

setMaxInactiveInterval($interval)

Set the default maximum inactive interval for Sessions created by this SessionManager.

Parameters:

$interval

the new interval, in seconds

PUBLIC METHODS

createSession()

Construct and return a Wombat::Session, based on the default settings specified by this SessionManager's fields. The session id will be assigned by this method.

Throws:

Servlet::Util::IllegalStateException

if a new Session cannot be created for, any reason

PACKAGE METHODS

Subclasses MUST override all of these methods.

add($session)

Add this Session to the set of active Sessions for this SessionManager.

Parameters:

$session

the Wombat::Session to be added

getName()

Return the display name of this SessionManager.

getSession($id)

Return the active Session managed by this SessionManager with the specified id, or undef if no session exists with that id.

Parameters:

$id

the id for the Session to be returned

Throws:

Servlet::Util::IllegalStateException

if the session exists but cannot be returned, for any reason

getSessions()

Return an array containing the active Sessions managed by this SessionManager.

remove($session)

Remove this Session from the active Sessions managed by this SessionManager.

Parameters:

$session

the Wombat::Session to remove

LIFECYCLE METHODS

start()

Prepare for active use of this SessionManager. This method should be called before any of the public methods of the SessionManager are utilized.

Throws:

Wombat::LifecycleException

if the SessionManager has already been started

stop()

Gracefully terminate active use of this SessionManager. Once this method has been called, no public methods of the SessionManager should be utilized.

Throws:

Wombat::LifecycleException

if the SessionManager is not started

SEE ALSO

Wombat::Container, Wombat::Core::Session

AUTHOR

Brian Moseley, bcm@maz.org