SPT Core API

com.sptci.echo.http
Class JDOApplicationListener

java.lang.Object
  extended by com.sptci.echo.http.ContextListener
      extended by com.sptci.echo.http.JDOApplicationListener
All Implemented Interfaces:
EventListener, HttpSessionListener, ServletContextListener

public abstract class JDOApplicationListener
extends ContextListener

A ServletContextListener and HttpSessionListener to close JDO resources that are held by the JDOApplication instance or its subclasses.

Since a web container usually allows only one instance of a context listener, this class is made abstract. You must create at the very least a dummy sub-class of this listener for your application and use as the listener for your application.

© Copyright 2006 Sans Pareil Technologies, Inc.

Version:
$Id: ContextListener.java 4626 2009-02-11 19:26:00Z rakesh $
Author:
Rakesh Vidyadharan 2009-06-14

Field Summary
 
Fields inherited from class com.sptci.echo.http.ContextListener
logger, SESSION_KEY
 
Constructor Summary
JDOApplicationListener()
           
 
Method Summary
protected  void close()
          Close a PersistenceManager instance if it is in effect for the application.
protected  void close(HttpSession session)
          Close a PersistenceManager instance bound to the JDOApplication.
 
Methods inherited from class com.sptci.echo.http.ContextListener
contextDestroyed, contextInitialized, getApplication, sessionCreated, sessionDestroyed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDOApplicationListener

public JDOApplicationListener()
Method Detail

close

protected void close(HttpSession session)
Close a PersistenceManager instance bound to the JDOApplication.

Specified by:
close in class ContextListener
Parameters:
session - The session in which the PM was established.

close

protected void close()
Close a PersistenceManager instance if it is in effect for the application.

Specified by:
close in class ContextListener
See Also:
PersistenceManagerFactory.close()

SPT Core API