Class DefaultChildApplicationContextManager
java.lang.Object
org.alfresco.repo.management.subsystems.AbstractPropertyBackedBean
org.alfresco.repo.management.subsystems.DefaultChildApplicationContextManager
- All Implemented Interfaces:
EventListener,ChildApplicationContextManager,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>
public class DefaultChildApplicationContextManager
extends AbstractPropertyBackedBean
implements ChildApplicationContextManager
A default
ChildApplicationContextManager implementation that manages a 'chain' of
ChildApplicationContextFactory objects, perhaps corresponding to the components of a chained subsystem such
as authentication. As with other PropertyBackedBeans, can be stopped, reconfigured, started and tested. Its
one special chain property allows an ordered list of ChildApplicationContextFactory objects to
be managed. This property is a comma separated list with the format:
- <id1>:<typeName1>,<id2>:<typeName2>,...,<idn>:<typeNamen>
ChildApplicationContextManager for the meanings of <id> and <typeName>. In the enterprise edition,
this property is editable at runtime via JMX. If a new <id> is included in the list then a new
ChildApplicationContextFactory will be brought into existence. Similarly, if one is removed from the list,
then the corresponding instance will be destroyed. For Alfresco community edition, the chain is best configured
through the method via Spring configuration.- Author:
- dward
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classThe Class ApplicationContextManagerState.Nested classes/interfaces inherited from class org.alfresco.repo.management.subsystems.AbstractPropertyBackedBean
AbstractPropertyBackedBean.DefaultResolver, AbstractPropertyBackedBean.RuntimeState -
Field Summary
Fields inherited from class org.alfresco.repo.management.subsystems.AbstractPropertyBackedBean
DEFAULT_INSTANCE_NAME, lock, runtimeState -
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new default child application context manager. -
Method Summary
Modifier and TypeMethodDescriptionprotected PropertyBackedBeanStateCreates the initial state.voiddestroy(boolean permanent) Releases any resources held by this component.org.springframework.context.ApplicationContextGets the application context with the given identifier.getDescription(String name) Gets a Human readable description of the property, e.g.Gets the ordered collection of identifiers, indicating the ordering of the chain.voidsetDefaultChain(String defaultChain) Configures the default chain ofChildApplicationContextFactoryinstances.voidsetDefaultTypeName(String defaultTypeName) Sets the default type name.Methods inherited from class org.alfresco.repo.management.subsystems.AbstractPropertyBackedBean
afterPropertiesSet, applyDefaultOverrides, destroy, doInit, getCategory, 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, stop
-
Constructor Details
-
DefaultChildApplicationContextManager
public DefaultChildApplicationContextManager()Instantiates a new default child application context manager.
-
-
Method Details
-
setDefaultTypeName
Sets the default type name. This is used when a type name is not included after an instance ID in a chain string.- Parameters:
defaultTypeName- the new default type name
-
setDefaultChain
Configures the default chain ofChildApplicationContextFactoryinstances. May be set on initialization by the Spring container.- Parameters:
defaultChain- a comma separated list in the following format:- <id1>:<typeName1>,<id2>:<typeName2>,...,<idn>:<typeNamen>
-
getDescription
Description copied from class:AbstractPropertyBackedBeanGets a Human readable description of the property, e.g. to provide via JMX.- Specified by:
getDescriptionin interfacePropertyBackedBean- Overrides:
getDescriptionin classAbstractPropertyBackedBean- Parameters:
name- the name- Returns:
- the description
-
destroy
public void destroy(boolean permanent) Description copied from class:AbstractPropertyBackedBeanReleases any resources held by this component.- Overrides:
destroyin classAbstractPropertyBackedBean- Parameters:
permanent- is the component being destroyed forever, i.e. should persisted values be removed? On server shutdown, this value would befalse, whereas on the removal of a dynamically created instance, this value would betrue.
-
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.
-
getInstanceIds
Description copied from interface:ChildApplicationContextManagerGets the ordered collection of identifiers, indicating the ordering of the chain.- Specified by:
getInstanceIdsin interfaceChildApplicationContextManager- Returns:
- an ordered collection of identifiers, indicating the ordering of the chain.
-
getApplicationContext
Description copied from interface:ChildApplicationContextManagerGets the application context with the given identifier.- Specified by:
getApplicationContextin interfaceChildApplicationContextManager- Parameters:
id- the identifier of the application context to retrieve- Returns:
- the application context with the given identifier or null if it does not exist
-
getChildApplicationContextFactory
-