org.jboss.portal.common.mc.bootstrap
Class WebBootstrap

java.lang.Object
  extended by org.jboss.portal.common.mc.bootstrap.WebBootstrap
All Implemented Interfaces:
java.util.EventListener, javax.servlet.ServletContextListener, org.jboss.kernel.spi.event.KernelEventListener

public class WebBootstrap
extends java.lang.Object
implements javax.servlet.ServletContextListener, org.jboss.kernel.spi.event.KernelEventListener

A kernel bootstrap with a life cycle triggered by the ServletContextListener interface. All beans will be injected as servlet context attributes. The bean xml file must be available as a servlet context resource under the path /WEB-INF/jboss-beans.xml.

Version:
$Revision: 1.1 $
Author:
Julien Viet

Field Summary
static java.lang.String BEANS_RESOURCE_LOCATION_KEY
          The servlet context init parameter name for the bean resource location.
static java.lang.String BEANS_RESOURCE_TYPE_KEY
          The servlet context init parameter name for the bean resource type which can be the servlet context or the web application classloader.
static java.lang.String CLASSLOADER_RESOURCE_TYPE
          Classloader resource type.
static java.lang.String CONTEXT_RESOURCE_TYPE
          Servlet context resource type.
static java.lang.String DEFAULT_JBOSS_BEANS_RESOURCE_LOCATION
          Default value for the bean resource location.
 
Constructor Summary
WebBootstrap()
           
 
Method Summary
 void contextDestroyed(javax.servlet.ServletContextEvent event)
           
 void contextInitialized(javax.servlet.ServletContextEvent event)
           
protected  java.net.URL getBeansURL()
           
 void onEvent(org.jboss.kernel.spi.event.KernelEvent event, java.lang.Object object)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BEANS_RESOURCE_LOCATION_KEY

public static final java.lang.String BEANS_RESOURCE_LOCATION_KEY
The servlet context init parameter name for the bean resource location. For instance for a web application resource it could be /WEB-INF/my-beans.xml, for the web application classloader resource it could be org/jboss/portal/my-beans.xml. If no init parameter is declared then the litteral value /WEB-INF/jboss-beans.xml is used and the lookup is done in the servlet context resourcees.

See Also:
Constant Field Values

BEANS_RESOURCE_TYPE_KEY

public static final java.lang.String BEANS_RESOURCE_TYPE_KEY
The servlet context init parameter name for the bean resource type which can be the servlet context or the web application classloader. If no value is specified the servlet context will be used for resource lookup. The legal values are context for the servlet context and classloader for the web application classloader.

See Also:
Constant Field Values

DEFAULT_JBOSS_BEANS_RESOURCE_LOCATION

public static final java.lang.String DEFAULT_JBOSS_BEANS_RESOURCE_LOCATION
Default value for the bean resource location.

See Also:
Constant Field Values

CONTEXT_RESOURCE_TYPE

public static final java.lang.String CONTEXT_RESOURCE_TYPE
Servlet context resource type.

See Also:
Constant Field Values

CLASSLOADER_RESOURCE_TYPE

public static final java.lang.String CLASSLOADER_RESOURCE_TYPE
Classloader resource type.

See Also:
Constant Field Values
Constructor Detail

WebBootstrap

public WebBootstrap()
Method Detail

contextInitialized

public void contextInitialized(javax.servlet.ServletContextEvent event)
Specified by:
contextInitialized in interface javax.servlet.ServletContextListener

contextDestroyed

public void contextDestroyed(javax.servlet.ServletContextEvent event)
Specified by:
contextDestroyed in interface javax.servlet.ServletContextListener

onEvent

public void onEvent(org.jboss.kernel.spi.event.KernelEvent event,
                    java.lang.Object object)
Specified by:
onEvent in interface org.jboss.kernel.spi.event.KernelEventListener

getBeansURL

protected java.net.URL getBeansURL()