org.productivity.java.habitat4j.web.servlet
Class Habitat4JBootstrapServletContextListener

java.lang.Object
  extended by org.productivity.java.habitat4j.web.servlet.Habitat4JBootstrapServletContextListener

public class Habitat4JBootstrapServletContextListener
extends java.lang.Object

Habitat4JBootstrapServletContextListener provides a ServletContextListener implementation for the use in initializing, or "bootstrapping," Habitat4J.

This class primarily wraps the Habitat4JBootstrap class.

For the listener specification in the Serlvet Web Descriptor (web.xml), use the following listener-class:

For the context-param configuration in the Web Descriptor (web.xml), use the following parameters:

## LICENSE INFORMATION ##

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Version:
$Id: Habitat4JBootstrapServletContextListener.html,v 1.2 2008/11/24 15:15:20 cvs Exp $
Author:
Justin Yunke <habitat4j@productivity.org>

Constructor Summary
Habitat4JBootstrapServletContextListener()
           
 
Method Summary
 void contextDestroyed(ServletContextEvent event)
           
 void contextInitialized(ServletContextEvent event)
           
protected  void doBootstrapInitialize(ServletContext context)
          doBootstrapInitialize() is used by the default init() method to setup Habitat4J in one step.
protected  void doBootstrapInitializePropertyLists(ServletContext context)
          doBootstrapInitializePropertyLists() is used when subclassing Habitat4JBootstrapServlet and overriding the init() method.
protected  void doBootstrapInitializeServerIdentity(ServletContext context)
          doBootstrapInitializeServerIdentity() is used when subclassing Habitat4JBootstrapServlet and overriding the init() method.
protected static java.util.Map getInitParametersAsMap(ServletContext context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Habitat4JBootstrapServletContextListener

public Habitat4JBootstrapServletContextListener()
Method Detail

getInitParametersAsMap

protected static java.util.Map getInitParametersAsMap(ServletContext context)
Parameters:
context - - the ServletContext instance
Returns:
Returns all init-param name/value pairs in the form of a Map (HashMap).

doBootstrapInitializeServerIdentity

protected void doBootstrapInitializeServerIdentity(ServletContext context)
                                            throws java.lang.RuntimeException
doBootstrapInitializeServerIdentity() is used when subclassing Habitat4JBootstrapServlet and overriding the init() method. It allows one to initialize the ServerIdentity as a separate step in order to do things like tweak pragma values before doBootstrapInitializePropertyLists() method is called.

Parameters:
context - - the ServletContext instance
Throws:
java.lang.RuntimeException

doBootstrapInitializePropertyLists

protected void doBootstrapInitializePropertyLists(ServletContext context)
                                           throws java.lang.RuntimeException
doBootstrapInitializePropertyLists() is used when subclassing Habitat4JBootstrapServlet and overriding the init() method. doBootstrapInitializeServerIdentity() should be called before this method.

Parameters:
context - - the ServletContext instance
Throws:
java.lang.RuntimeException

doBootstrapInitialize

protected void doBootstrapInitialize(ServletContext context)
                              throws java.lang.RuntimeException
doBootstrapInitialize() is used by the default init() method to setup Habitat4J in one step.

Parameters:
context - - the ServletContext instance
Throws:
java.lang.RuntimeException

contextDestroyed

public void contextDestroyed(ServletContextEvent event)

contextInitialized

public void contextInitialized(ServletContextEvent event)