com.adaptrex.core
Class AdaptrexContextListener
java.lang.Object
com.adaptrex.core.AdaptrexContextListener
- All Implemented Interfaces:
- EventListener, javax.servlet.ServletContextListener
public class AdaptrexContextListener
- extends Object
- implements javax.servlet.ServletContextListener
This ServletContextListener bootstraps Adaptrex. By default this creates an instance
of the Adaptrex service. It makes the service available as a static field on the Adaptrex
class and also places it in the ServletContext "adaptrex" attribute.
To use the defaults, add the following to your application's web.xml:
<listener>
<listener-class>com.adaptrex.core.AdpatrexContextListener</listener-class>
</listener>
If you would like to bootstrap Adaptrex yourself, you must at least create an Adaptrex
instance and initialize it method such as in the following example:
Adaptrex adaptrex = new Adaptrex(event.getServletContext());
Adaptrex.init(adaptrex);
You can then register the Adaptrex service instance with your container using whatever
mechanism you would like.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AdaptrexContextListener
public AdaptrexContextListener()
contextInitialized
public void contextInitialized(javax.servlet.ServletContextEvent event)
- Specified by:
contextInitialized in interface javax.servlet.ServletContextListener
contextDestroyed
public void contextDestroyed(javax.servlet.ServletContextEvent sce)
- Specified by:
contextDestroyed in interface javax.servlet.ServletContextListener
Copyright © 2012 Adaptrex, LLC. All Rights Reserved.