org.hibernate.tutorial.web
Class SessionFactoryInitializer
java.lang.Object
org.hibernate.tutorial.web.SessionFactoryInitializer
- All Implemented Interfaces:
- EventListener, ServletContextListener
public class SessionFactoryInitializer
- extends Object
- implements 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(ServletContextEvent event)
- Specified by:
contextInitialized
in interface ServletContextListener
contextDestroyed
public void contextDestroyed(ServletContextEvent event)
- Specified by:
contextDestroyed
in interface ServletContextListener
Copyright © 2009 Hibernate.org. All Rights Reserved.