org.abstracthorizon.extend.support.spring.service
Class ServiceApplicationContextModule

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
All Implemented Interfaces:
Module, BeanFactory, DisposableBean, HierarchicalBeanFactory, ListableBeanFactory, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, ResourceLoader, ResourcePatternResolver
Direct Known Subclasses:
DanubeWebApplicationContext, JettyWebApplicationContext, TomcatWebApplicationContext

public class ServiceApplicationContextModule
extends AbstractApplicationContextModule

Module that represents a service. It tracks service beans (beans marked with <service> tag). When module is created/started/stopped/destroyed then create/start/stop/destroy method is called on all service beans. Note: actual method name can be specified in <service> tag.

Author:
Daniel Sendula

Nested Class Summary
 
Nested classes/interfaces inherited from class org.abstracthorizon.extend.support.spring.deployment.AbstractApplicationContextModule
AbstractApplicationContextModule.DeployersDefaultListableBeanFactory
 
Field Summary
protected  Set<ServiceBean> serviceBeans
          List of service beans
 
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
ServiceApplicationContextModule(ModuleId moduleId)
          Empty constructor
 
Method Summary
protected  void createInternal()
          Invokes create method on all service beans
protected  void destroyInternal()
          Invokes destroy method on all service beans
 Set<ServiceBean> getServiceBeans()
           
protected  void initBeanDefinitionReader(XmlBeanDefinitionReader xmlbeandefinitionreader)
          Sets up parser for this application context.
 void setServiceBeans(Set<ServiceBean> serviceBeans)
           
protected  void startInternal()
          Invokes start method on all service beans
protected  void stopInternal()
          Invokes stop method on all service beans
 
Methods inherited from class org.abstracthorizon.extend.support.spring.deployment.AbstractApplicationContextModule
create, createBeanFactory, createClassLoaders, createServiceFile, destroy, equals, getClassLoader, getConfigLocations, getContextFileName, 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

serviceBeans

protected Set<ServiceBean> serviceBeans
List of service beans

Constructor Detail

ServiceApplicationContextModule

public ServiceApplicationContextModule(ModuleId moduleId)
Empty constructor

Method Detail

initBeanDefinitionReader

protected void initBeanDefinitionReader(XmlBeanDefinitionReader xmlbeandefinitionreader)
Sets up parser for this application context. This implementation uses ServiceApplicationContextModuleXmlParser without validation with AbstractApplicationContextModule.internalClassLoader.

Overrides:
initBeanDefinitionReader in class AbstractApplicationContextModule

createInternal

protected void createInternal()
Invokes create method on all service beans

Specified by:
createInternal in class AbstractApplicationContextModule

startInternal

protected void startInternal()
Invokes start method on all service beans

Specified by:
startInternal in class AbstractApplicationContextModule

stopInternal

protected void stopInternal()
Invokes stop method on all service beans

Specified by:
stopInternal in class AbstractApplicationContextModule

destroyInternal

protected void destroyInternal()
Invokes destroy method on all service beans

Specified by:
destroyInternal in class AbstractApplicationContextModule

getServiceBeans

public Set<ServiceBean> getServiceBeans()
Returns:
Returns the serviceBeans.

setServiceBeans

public void setServiceBeans(Set<ServiceBean> serviceBeans)
Parameters:
serviceBeans - The serviceBeans to set.


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