org.hibernate.tutorial.web
Class SessionFactoryInitializer
java.lang.Object
org.hibernate.tutorial.web.SessionFactoryInitializer
- All Implemented Interfaces:
- EventListener, javax.servlet.ServletContextListener
public class SessionFactoryInitializer
- extends Object
- implements javax.servlet.ServletContextListener
Demonstrates good practice of making sure the SessionFactory is initialized
on application startup, rather than on first request. Here we register
as a listener to the servlet context lifecycle for building/closing of the
SessionFactory.
- Author:
- Steve Ebersole
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SessionFactoryInitializer
public SessionFactoryInitializer()
contextInitialized
public void contextInitialized(javax.servlet.ServletContextEvent event)
- Specified by:
contextInitialized
in interface javax.servlet.ServletContextListener
contextDestroyed
public void contextDestroyed(javax.servlet.ServletContextEvent event)
- Specified by:
contextDestroyed
in interface javax.servlet.ServletContextListener
Copyright © null-null Red Hat Middleware, LLC. All Rights Reserved