com.taggercat
Class ContextListener

java.lang.Object
  extended by com.taggercat.ContextListener
All Implemented Interfaces:
java.util.EventListener, javax.servlet.ServletContextListener

public class ContextListener
extends java.lang.Object
implements javax.servlet.ServletContextListener

This is a context listener to initialize Hibernate, as well as our meta data collection and the default Security provider. This context listener ( or a similar one ) must be included in your application's deployment descriptor. This context listener is not specified in TaggerCat's TLD to make it easier to plug in your own implementations.

The Hibernate Session Factory is placed in the application scope as:
Constants.TC_HBN8_SESSION_FACTORY
The Runtime metadata is placed in the application scope as:
Constants.TC_HBN8_METADATA
The Security Provider is placed in the application scope as:
Constants.TC_SECURITY_PROVIDER
The name of the controller servlet is placed in the application scope as:
Constants.TC_CONTROLLER_SERVLET

 

Constructor Summary
ContextListener()
           
 
Method Summary
 void contextDestroyed(javax.servlet.ServletContextEvent event)
           
 void contextInitialized(javax.servlet.ServletContextEvent event)
           
 javax.servlet.ServletContext getServletContext()
           
static void loadTCMetaData(javax.servlet.ServletContext servletContext, org.hibernate.cfg.Configuration hbn8Config, org.hibernate.SessionFactory sessionFactory, java.lang.Boolean isMultiTenant)
           
 void preSessionFactoryBuild(org.hibernate.cfg.Configuration hbn8Config)
          An extension point for sub-classes to add in their own configuration properties.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextListener

public ContextListener()
Method Detail

contextInitialized

public void contextInitialized(javax.servlet.ServletContextEvent event)
Specified by:
contextInitialized in interface javax.servlet.ServletContextListener

loadTCMetaData

public static void loadTCMetaData(javax.servlet.ServletContext servletContext,
                                  org.hibernate.cfg.Configuration hbn8Config,
                                  org.hibernate.SessionFactory sessionFactory,
                                  java.lang.Boolean isMultiTenant)
                           throws java.lang.Exception
Throws:
java.lang.Exception
Parameters:
hbn8Config -
sessionFactory -

preSessionFactoryBuild

public void preSessionFactoryBuild(org.hibernate.cfg.Configuration hbn8Config)
An extension point for sub-classes to add in their own configuration properties. The default implementation does nothing.

Parameters:
hbn8Config -

contextDestroyed

public void contextDestroyed(javax.servlet.ServletContextEvent event)
Specified by:
contextDestroyed in interface javax.servlet.ServletContextListener

getServletContext

public javax.servlet.ServletContext getServletContext()