org.ow2.easybeans.server.war
Class EasyBeansContextListener

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

public class EasyBeansContextListener
extends java.lang.Object
implements 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

Field Summary
static java.lang.String DEFAULT_XML_FILE
          Default XML file.
 
Constructor Summary
EasyBeansContextListener()
           
 
Method Summary
protected  void addLib(java.lang.ClassLoader cl, ServletContextEvent servletContextEvent)
          Add libraries in the given classloader.
 void contextDestroyed(ServletContextEvent servletContextEvent)
          Notification that the servlet context is about to be shut down.
 void contextInitialized(ServletContextEvent servletContextEvent)
          Notification that the web application initialization process is starting.
protected  java.util.List<java.lang.String> getExportedLibraries()
           
protected  void getLibraries(ServletContext sContext, java.util.List<java.lang.String> libraries)
          Retrieve a List of libraries to be loaded by TopLevel ClassLoaders.
protected  org.ow2.easybeans.server.ServerConfig getServerConfig()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_XML_FILE

public static final java.lang.String DEFAULT_XML_FILE
Default XML file.

See Also:
Constant Field Values
Constructor Detail

EasyBeansContextListener

public EasyBeansContextListener()
Method Detail

contextInitialized

public void contextInitialized(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 ServletContextListener
Parameters:
servletContextEvent - event class for notifications about changes to the servlet context of a web application.

contextDestroyed

public void contextDestroyed(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 ServletContextListener
Parameters:
servletContextEvent - event class for notifications about changes to the servlet context of a web application.

addLib

protected void addLib(java.lang.ClassLoader cl,
                      ServletContextEvent servletContextEvent)
Add libraries in the given classloader.

Parameters:
cl - the classloader where to add jars (which needs to be an URLClassLoader)
servletContextEvent - the servlet context event

getLibraries

protected void getLibraries(ServletContext sContext,
                            java.util.List<java.lang.String> libraries)
Retrieve a List of libraries to be loaded by TopLevel ClassLoaders.

Parameters:
sContext - ServletContext.
libraries - List of libs.

getExportedLibraries

protected java.util.List<java.lang.String> getExportedLibraries()
Returns:
a List of resources that contains the libraries to be exported.

getServerConfig

protected org.ow2.easybeans.server.ServerConfig getServerConfig()
Returns:
returns the Easybeans ServerConfig object.


Copyright © 2006-2008 OW2 Consortium. All Rights Reserved.