org.abstracthorizon.spring.server.deployment.jetty
Class JettyWebApplicationContext

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.spring.server.deployment.jetty.JettyWebApplicationContext
All Implemented Interfaces:
Module, BeanFactory, DisposableBean, HierarchicalBeanFactory, ListableBeanFactory, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, ResourceLoader, ResourcePatternResolver

public class JettyWebApplicationContext
extends ServiceApplicationContextModule

Module that represents a war module deployed with Jetty. 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.mortbay.jetty.webapp.WebAppContext context
          Jetty context
protected  String contextPath
          Context path for this module
protected  org.mortbay.jetty.Server jetty
          Reference to embedded Jetty
protected  ApplicationContext webServerContext
          Context of web server - Jetty'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
JettyWebApplicationContext(ModuleId moduleId)
          Empty constructor
 
Method Summary
protected  void createInternal()
          Obtains references to the embedded Jetty and to the host.
protected  void destroyInternal()
          Removes all references of the embedded Jetty and the host
protected  String getContextFileName()
          It uses "WEB-INF/web-application.xml" for application context xml.
 String getContextPath()
           
 org.mortbay.jetty.servlet.Context getJettyContext()
          Returns Jetty context
 ApplicationContext getWebServerContext()
          Jetty's service application context
 void setContextPath(String contextPath)
           
 void setWebServerContext(ApplicationContext webServerContext)
          Set's Jetty'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

jetty

protected org.mortbay.jetty.Server jetty
Reference to embedded Jetty


context

protected org.mortbay.jetty.webapp.WebAppContext context
Jetty context


webServerContext

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


contextPath

protected String contextPath
Context path for this module

Constructor Detail

JettyWebApplicationContext

public JettyWebApplicationContext(ModuleId moduleId)
Empty constructor

Method Detail

createInternal

protected void createInternal()
Obtains references to the embedded Jetty and to the host. Sets this module to be depended on Jetty'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 Jetty 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()
Jetty's service application context

Returns:
Jetty's service application context

setWebServerContext

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

Parameters:
webServerContext - Jetty's service application context

getContextPath

public String getContextPath()
Returns:
Returns the contextPath.

setContextPath

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

getJettyContext

public org.mortbay.jetty.servlet.Context getJettyContext()
Returns Jetty context

Returns:
Jetty context


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