Class SwitchableApplicationContextFactory
java.lang.Object
org.alfresco.repo.management.subsystems.AbstractPropertyBackedBean
org.alfresco.repo.management.subsystems.SwitchableApplicationContextFactory
- All Implemented Interfaces:
EventListener,ApplicationContextFactory,PropertyBackedBean,PropertyBackedBeanState,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>
- Direct Known Subclasses:
CryptodocSwitchableApplicationContextFactory
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
Nested ClassesModifier and TypeClassDescriptionprotected classRepresents the state of aSwitchableApplicationContextFactory.Nested classes/interfaces inherited from class org.alfresco.repo.management.subsystems.AbstractPropertyBackedBean
AbstractPropertyBackedBean.DefaultResolver, AbstractPropertyBackedBean.RuntimeState -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringThe name of the property holding the bean name of the sourceApplicationContextFactory.protected StringThe default bean name of the sourceApplicationContextFactory.Fields inherited from class org.alfresco.repo.management.subsystems.AbstractPropertyBackedBean
DEFAULT_INSTANCE_NAME, lock, runtimeState -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected PropertyBackedBeanStateCreates the initial state.org.springframework.context.ApplicationContextGets the application context, configured according to the properties of the factory.voidsetSourceBeanName(String sourceBeanName) Sets the default bean name of the sourceApplicationContextFactory.Methods inherited from class org.alfresco.repo.management.subsystems.AbstractPropertyBackedBean
afterPropertiesSet, applyDefaultOverrides, destroy, destroy, doInit, getCategory, getDescription, getEncryptedPropertyDefaults, getId, getInstancePath, getParent, getProperty, getPropertyDefaults, getPropertyNames, getRegistry, getState, init, isUpdateable, onApplicationEvent, performEarlyPropertyChecks, removeProperties, removeProperty, resolveDefault, revert, setApplicationContext, setAutoStart, setBeanName, setCategory, setEarlyPropertyCheckers, setEncryptedPropertyDefaults, setInstancePath, setProperties, setProperty, setPropertyDefaults, setRegistry, setSaveSetProperty, start, start, stop, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecutionMethods inherited from interface org.alfresco.repo.management.subsystems.PropertyBackedBean
getDescription, getId, isUpdateable, removeProperties, revert, setPropertiesMethods inherited from interface org.alfresco.repo.management.subsystems.PropertyBackedBeanState
getProperty, getPropertyNames, removeProperty, setProperty, start, stop
-
Field Details
-
SOURCE_BEAN_PROPERTY
The name of the property holding the bean name of the sourceApplicationContextFactory.- See Also:
-
sourceBeanName
The default bean name of the sourceApplicationContextFactory.
-
-
Constructor Details
-
SwitchableApplicationContextFactory
public SwitchableApplicationContextFactory()
-
-
Method Details
-
setSourceBeanName
Sets the default bean name of the sourceApplicationContextFactory.- Parameters:
sourceBeanName- the bean name
-
getCurrentSourceBeanName
-
getApplicationContext
public org.springframework.context.ApplicationContext getApplicationContext()Description copied from interface:ApplicationContextFactoryGets the application context, configured according to the properties of the factory.- Specified by:
getApplicationContextin interfaceApplicationContextFactory- Returns:
- the application context
-
createInitialState
Description copied from class:AbstractPropertyBackedBeanCreates the initial state.- Specified by:
createInitialStatein classAbstractPropertyBackedBean- Returns:
- the property backed bean state
- Throws:
IOException- Signals that an I/O exception has occurred.
-