org.objectweb.easybeans.server.war
Class EasyBeansContextListener

java.lang.Object
  extended by org.objectweb.easybeans.server.war.EasyBeansContextListener
All Implemented Interfaces:
java.util.EventListener, javax.servlet.ServletContextListener

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

Listener class which is notified of lifecycle events. It allows to start EasyBeans at startup and stop it at the end.

Author:
Florent Benoit

Nested Class Summary
private static class EasyBeansContextListener.AvailableWebContainer
          List of available supported container.
 
Field Summary
private  EasyBeansContextListener.AvailableWebContainer containerType
          Container detected ?.
private  Embedded embedded
          Embedded instance.
private static JLog logger
          Logger.
 
Constructor Summary
EasyBeansContextListener()
           
 
Method Summary
 void contextDestroyed(javax.servlet.ServletContextEvent servletContextEvent)
          Notification that the servlet context is about to be shut down.
 void contextInitialized(javax.servlet.ServletContextEvent servletContextEvent)
          Notification that the web application initialization process is starting.
private  java.lang.String detectWebContainerDirectory()
          Gets the directory for EJB3 depending on the servlet container.
private  void registerLibraries(javax.servlet.ServletContextEvent servletContextEvent)
          Register the EasyBeans libraries in the root classloader (allowing each applications to communicate with EasyBeans).
private  void registerTomcat(javax.servlet.ServletContextEvent servletContextEvent)
          Register the EasyBeans libraries for Tomcat.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static JLog logger
Logger.


embedded

private Embedded embedded
Embedded instance.


containerType

private EasyBeansContextListener.AvailableWebContainer containerType
Container detected ?.

Constructor Detail

EasyBeansContextListener

public EasyBeansContextListener()
Method Detail

contextInitialized

public void contextInitialized(javax.servlet.ServletContextEvent servletContextEvent)
Notification that the web application initialization process is starting. All ServletContextListeners are notified of context initialization before any filter or servlet in the web application is initialized.

Specified by:
contextInitialized in interface javax.servlet.ServletContextListener
Parameters:
servletContextEvent - event class for notifications about changes to the servlet context of a web application.

contextDestroyed

public void contextDestroyed(javax.servlet.ServletContextEvent servletContextEvent)
Notification that the servlet context is about to be shut down. All servlets and filters have been destroy()ed before any ServletContextListeners are notified of context destruction.

Specified by:
contextDestroyed in interface javax.servlet.ServletContextListener
Parameters:
servletContextEvent - event class for notifications about changes to the servlet context of a web application.

detectWebContainerDirectory

private java.lang.String detectWebContainerDirectory()
Gets the directory for EJB3 depending on the servlet container.

Returns:
path to catalina.base/jetty.home/etc.

registerLibraries

private void registerLibraries(javax.servlet.ServletContextEvent servletContextEvent)
Register the EasyBeans libraries in the root classloader (allowing each applications to communicate with EasyBeans).

Parameters:
servletContextEvent - event class for notifications about changes to the servlet context of a web application.

registerTomcat

private void registerTomcat(javax.servlet.ServletContextEvent servletContextEvent)
Register the EasyBeans libraries for Tomcat.

Parameters:
servletContextEvent - event class for notifications about changes to the servlet context of a web application.