org.alfresco.repo.management.subsystems
Class SwitchableApplicationContextFactory

java.lang.Object
  extended by org.alfresco.repo.management.subsystems.AbstractPropertyBackedBean
      extended by org.alfresco.repo.management.subsystems.SwitchableApplicationContextFactory
All Implemented Interfaces:
java.util.EventListener, ApplicationContextFactory, PropertyBackedBean, PropertyBackedBeanState, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener

public class SwitchableApplicationContextFactory
extends AbstractPropertyBackedBean
implements ApplicationContextFactory

A configurable proxy for a set of ApplicationContextFactory beans that allows dynamic selection of one or more alternative subsystems via a sourceBeanName property. As with other PropertyBackedBeans, can be stopped, reconfigured, started and tested.


Nested Class Summary
protected  class SwitchableApplicationContextFactory.SwitchableState
          Represents the state of a SwitchableApplicationContextFactory.
 
Nested classes/interfaces inherited from class org.alfresco.repo.management.subsystems.AbstractPropertyBackedBean
AbstractPropertyBackedBean.DefaultResolver
 
Field Summary
 
Fields inherited from class org.alfresco.repo.management.subsystems.AbstractPropertyBackedBean
DEFAULT_INSTANCE_NAME, lock
 
Constructor Summary
SwitchableApplicationContextFactory()
           
 
Method Summary
protected  PropertyBackedBeanState createInitialState()
          Creates the initial state.
 org.springframework.context.ApplicationContext getApplicationContext()
          Gets the application context, configured according to the properties of the factory.
 void setSourceBeanName(java.lang.String sourceBeanName)
          Sets the default bean name of the source ApplicationContextFactory.
 
Methods inherited from class org.alfresco.repo.management.subsystems.AbstractPropertyBackedBean
afterPropertiesSet, applyDefaultOverrides, destroy, destroy, doInit, getCategory, getDescription, getId, getInstancePath, getParent, getProperty, getPropertyDefaults, getPropertyNames, getRegistry, getState, init, isUpdateable, onApplicationEvent, resolveDefault, revert, setApplicationContext, setAutoStart, setBeanName, setCategory, setInstancePath, setProperties, setProperty, setPropertyDefaults, setRegistry, start, start, stop, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.alfresco.repo.management.subsystems.PropertyBackedBean
getDescription, getId, isUpdateable, revert, setProperties
 
Methods inherited from interface org.alfresco.repo.management.subsystems.PropertyBackedBeanState
getProperty, getPropertyNames, setProperty, start, stop
 

Constructor Detail

SwitchableApplicationContextFactory

public SwitchableApplicationContextFactory()
Method Detail

setSourceBeanName

public void setSourceBeanName(java.lang.String sourceBeanName)
Sets the default bean name of the source ApplicationContextFactory.

Parameters:
sourceBeanName - the bean name

getApplicationContext

public org.springframework.context.ApplicationContext getApplicationContext()
Description copied from interface: ApplicationContextFactory
Gets the application context, configured according to the properties of the factory.

Specified by:
getApplicationContext in interface ApplicationContextFactory
Returns:
the application context

createInitialState

protected PropertyBackedBeanState createInitialState()
                                              throws java.io.IOException
Description copied from class: AbstractPropertyBackedBean
Creates the initial state.

Specified by:
createInitialState in class AbstractPropertyBackedBean
Returns:
the property backed bean state
Throws:
java.io.IOException - Signals that an I/O exception has occurred.


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.