A factory allowing initialization of an entire 'subsystem' in a child application context. As with other
PropertyBackedBeans, can be stopped, reconfigured, started and tested. Each instance possesses a
property, that determines where the factory will look for default configuration for the
application context. In addition, its
property will determine where the factory will look for
override configuration in the extension classpath.
The factory will search for a Spring application context in the classpath using the following patterns in order:
The child application context may use
placeholders, and will be configured with a
PropertyPlaceholderConfigurer initialized with properties files found in classpath matching the following
patterns in order:
This means that the extension classpath can be used to provide instance-specific overrides to product default
settings. Of course, if you are using the Enterprise edition, you might want to use a JMX client such as JConsole to
edit the settings instead!
For advanced purposes, the class also allows management of 'composite' properties, that is properties that can be
populated with a sequence of zero or more objects, themselves registered as property-backed beans. Using the
compositePropertyTypes property you can register a Map of property names to Java Bean classes. Each
property named in this map will then be materialized as a 'composite' property.
Composite property settings are best controlled either through a JMX console (Enterprise edition only) or
/alfresco-global.properties in the classpath (the replacement to /alfresco/extension/custom-repository.properties).
For example, suppose "imap.server.mountPoints" was registered as a composite property of type
RepositoryPathConfigBean. You can then use the property to configure a list of
RepositoryPathConfigBeans. First you specify in the property's value a list of zero or more 'instance names'.
Each name must be unique within the property.
Then, by magic you have two separate instances of
RepositoryPathConfigBean whose properties you can address
through an extended set of properties prefixed by "imap.server.mountPoints".
To set a property on one of the instances, you append ".value.<instance name>.<bean property name>" to the
parent property name. For example:
To specify a default value for a property on all instances of the bean, you append ".default.<bean property name>"
to the parent property name. For example:
Note that it's perfectly valid to use placeholders in property values that will be resolved from other global
In order to actually utilize this configurable list of beans in your child application context, you simply need to
ListFactoryBean whose ID is the same name as the property. For example:
<bean id="imap.server.mountPoints" class="org.springframework.beans.factory.config.ListFactoryBean">
<!-- Whatever you declare in here will get replaced by the property value list -->
<!-- This property is not actually required at all -->
Then, when the application context is started and before that bean is initialized, it will be given the current
configured list of values for the composite property. Magic! This all sounds like a complex, yet primitive
replacement for Spring, but it means you can do powerful things to reconfigure the system through an admin UI rather
than editing XML.