Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.turbine.services.session
Class SessionListener

    java.lang.Object
      org.apache.turbine.services.session.SessionListener

All Implemented Interfaces:
  Serializable, EventListener, javax.servlet.http.HttpSessionActivationListener, javax.servlet.http.HttpSessionListener

    public class SessionListener

extends Object
implements javax.servlet.http.HttpSessionListener, javax.servlet.http.HttpSessionActivationListener, Serializable

This class is a listener for both session creation and destruction, and for session activation and passivation. It must be configured via your web application's `web.xml` deployment descriptor as follows for the container to call it:

> `

>      <listener>
>        <listener-class>
>          org.apache.turbine.session.SessionListener
>        </listener-class>
>      </listener>

> `

`<listener>` elemements can occur between `<context-param>` and `<servlet>` elements in your deployment descriptor. The `sessionCreated(HttpSessionEvent)` callback will automatically add an instance of this listener to any newly created `HttpSession` for detection of session passivation and re-activation.

Since:
  2.3
Version:
  $Id: SessionListener.java 1066925 2011-02-03 19:44:37Z ludwig $
Author:
  Quinton McCombs, Daniel Rall
See Also:
  `HttpSessionListener`, Serialized Form

Constructor Summary
`SessionListener()`

Method Summary
`void` | `sessionCreated(javax.servlet.http.HttpSessionEvent event)` Called by the servlet container when a new session is created
`void` | `sessionDestroyed(javax.servlet.http.HttpSessionEvent event)` Called by the servlet container when a session is destroyed
`void` | `sessionDidActivate(javax.servlet.http.HttpSessionEvent event)` Called by the servlet container when an existing session is (re-)activated.
`void` | `sessionWillPassivate(javax.servlet.http.HttpSessionEvent event)` Called by the servlet container when a an existing session is passivated.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SessionListener

    public SessionListener()

Method Detail

### sessionCreated

    public void sessionCreated(javax.servlet.http.HttpSessionEvent event)

  Called by the servlet container when a new session is created

  Specified by:
    `sessionCreated` in interface `javax.servlet.http.HttpSessionListener`
  Parameters:
    `event` - Session creation event.

### sessionDestroyed

    public void sessionDestroyed(javax.servlet.http.HttpSessionEvent event)

  Called by the servlet container when a session is destroyed

  Specified by:
    `sessionDestroyed` in interface `javax.servlet.http.HttpSessionListener`
  Parameters:
    `event` - Session destruction event.

### sessionDidActivate

    public void sessionDidActivate(javax.servlet.http.HttpSessionEvent event)

  Called by the servlet container when an existing session is (re-)activated.

  Specified by:
    `sessionDidActivate` in interface `javax.servlet.http.HttpSessionActivationListener`
  Parameters:
    `event` - Session activation event.

### sessionWillPassivate

    public void sessionWillPassivate(javax.servlet.http.HttpSessionEvent event)

  Called by the servlet container when a an existing session is passivated.

  Specified by:
    `sessionWillPassivate` in interface `javax.servlet.http.HttpSessionActivationListener`
  Parameters:
    `event` - Session passivation event.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2011 The Apache Software Foundation. All Rights Reserved.