org.abstracthorizon.extend.server.deployment.tomcat
Class TomcatWebApplicationContext

java.lang.Object
  extended by org.springframework.core.io.DefaultResourceLoader
      extended by org.springframework.context.support.AbstractApplicationContext
          extended by org.springframework.context.support.AbstractRefreshableApplicationContext
              extended by org.springframework.context.support.AbstractXmlApplicationContext
                  extended by org.abstracthorizon.extend.support.spring.deployment.AbstractApplicationContextModule
                      extended by org.abstracthorizon.extend.support.spring.service.ServiceApplicationContextModule
                          extended by org.abstracthorizon.extend.server.deployment.tomcat.TomcatWebApplicationContext
All Implemented Interfaces:
Module, BeanFactory, DisposableBean, HierarchicalBeanFactory, ListableBeanFactory, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, ResourceLoader, ResourcePatternResolver

public class TomcatWebApplicationContext
extends ServiceApplicationContextModule

Module that represents a war module deployed with tomcat. Also it can define beans in a same way as service application module (this is an extension of it).

It uses "WEB-INF/web-application.xml" for application context xml.

Author:
Daniel Sendula

Nested Class Summary
 
Nested classes/interfaces inherited from class org.abstracthorizon.extend.support.spring.deployment.AbstractApplicationContextModule
AbstractApplicationContextModule.DeployersDefaultListableBeanFactory
 
Field Summary
protected  org.apache.catalina.Context context
          Context this module is running under
protected  String contextPath
          Context path for this module
protected  org.apache.catalina.Host host
          Reference to the Host this context is deploy under
protected  org.apache.catalina.startup.Embedded tomcat
          Reference to embedded tomcat
protected  ApplicationContext webServerContext
          Context of web server - tomcat's service application context
 
Fields inherited from class org.abstracthorizon.extend.support.spring.service.ServiceApplicationContextModule
serviceBeans
 
Fields inherited from class org.abstracthorizon.extend.support.spring.deployment.AbstractApplicationContextModule
dependOnThis, dependsOn, deploymentManager, internalClassLoader, moduleId, originalLocation, overallClassLoader, serviceFile, state, workingLocation
 
Fields inherited from class org.springframework.context.support.AbstractApplicationContext
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, MESSAGE_SOURCE_BEAN_NAME
 
Fields inherited from interface org.abstracthorizon.extend.server.deployment.Module
CREATED, DEFINED, STARTED, UNDEFINED, WAITING_ON_CREATE, WAITING_ON_CREATE_TO_START, WAITING_ON_START
 
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
 
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
 
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
 
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
 
Constructor Summary
TomcatWebApplicationContext(ModuleId moduleId)
          Empty constructor
 
Method Summary
protected  void createInternal()
          Obtains references to the embedded tomcat and to the host.
protected  void destroyInternal()
          Removes all references of the embedded tomcat and the host
protected  String getContextFileName()
          It uses "WEB-INF/web-application.xml" for application context xml.
 String getContextPath()
           
 org.apache.catalina.Context getTomcatContext()
          Returns tomcat context
 ApplicationContext getWebServerContext()
          Tomcat's service application context
 void setContextPath(String contextPath)
           
 void setWebServerContext(ApplicationContext webServerContext)
          Set's tomcat's service application context
protected  void startInternal()
          Creates and adds context to the obtained reference of the host.
protected  void stopInternal()
          Removes context from the host.
 
Methods inherited from class org.abstracthorizon.extend.support.spring.service.ServiceApplicationContextModule
getServiceBeans, initBeanDefinitionReader, setServiceBeans
 
Methods inherited from class org.abstracthorizon.extend.support.spring.deployment.AbstractApplicationContextModule
create, createBeanFactory, createClassLoaders, createServiceFile, destroy, equals, getClassLoader, getConfigLocations, getDependOnThis, getDependsOn, getDeploymentManager, getModuleId, getOriginalLocation, getResource, getServiceFile, getState, getStateAsString, getWorkingLocation, processDependencies, setDeploymentManager, setLocation, setModuleId, setOriginalLocation, setState, start, stop, toString
 
Methods inherited from class org.springframework.context.support.AbstractXmlApplicationContext
getConfigResources, loadBeanDefinitions, loadBeanDefinitions
 
Methods inherited from class org.springframework.context.support.AbstractRefreshableApplicationContext
closeBeanFactory, customizeBeanFactory, getBeanFactory, refreshBeanFactory
 
Methods inherited from class org.springframework.context.support.AbstractApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, addListener, close, containsBean, containsBeanDefinition, containsLocalBean, destroyBeans, doClose, getAliases, getApplicationListeners, getAutowireCapableBeanFactory, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getDisplayName, getInternalParentBeanFactory, getInternalParentMessageSource, getLifecycleBeans, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResourcePatternResolver, getResources, getStartupDate, getType, initApplicationEventMulticaster, initMessageSource, invokeBeanFactoryPostProcessors, isActive, isPrototype, isRunning, isSingleton, isTypeMatch, obtainFreshBeanFactory, onClose, onRefresh, postProcessBeanFactory, prepareBeanFactory, prepareRefresh, publishEvent, refresh, registerBeanPostProcessors, registerListeners, registerShutdownHook, setDisplayName, setParent
 
Methods inherited from class org.springframework.core.io.DefaultResourceLoader
getResourceByPath, setClassLoader
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tomcat

protected org.apache.catalina.startup.Embedded tomcat
Reference to embedded tomcat


host

protected org.apache.catalina.Host host
Reference to the Host this context is deploy under


context

protected org.apache.catalina.Context context
Context this module is running under


webServerContext

protected ApplicationContext webServerContext
Context of web server - tomcat's service application context


contextPath

protected String contextPath
Context path for this module

Constructor Detail

TomcatWebApplicationContext

public TomcatWebApplicationContext(ModuleId moduleId)
Empty constructor

Method Detail

createInternal

protected void createInternal()
Obtains references to the embedded tomcat and to the host. Sets this module to be depended on tomcat's service application module.

Overrides:
createInternal in class ServiceApplicationContextModule

startInternal

protected void startInternal()
Creates and adds context to the obtained reference of the host.

Overrides:
startInternal in class ServiceApplicationContextModule

stopInternal

protected void stopInternal()
Removes context from the host.

Overrides:
stopInternal in class ServiceApplicationContextModule

destroyInternal

protected void destroyInternal()
Removes all references of the embedded tomcat and the host

Overrides:
destroyInternal in class ServiceApplicationContextModule

getContextFileName

protected String getContextFileName()
It uses "WEB-INF/web-application.xml" for application context xml.

Overrides:
getContextFileName in class AbstractApplicationContextModule
Returns:
"WEB-INF/web-application.xml"

getWebServerContext

public ApplicationContext getWebServerContext()
Tomcat's service application context

Returns:
tomcat's service application context

setWebServerContext

public void setWebServerContext(ApplicationContext webServerContext)
Set's tomcat's service application context

Parameters:
webServerContext - tomcat's service application context

getContextPath

public String getContextPath()
Returns:
Returns the contextPath.

setContextPath

public void setContextPath(String contextPath)
Parameters:
contextPath - The contextPath to set.

getTomcatContext

public org.apache.catalina.Context getTomcatContext()
Returns tomcat context

Returns:
tomcat context


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.