Class GenericFactory

All Implemented Interfaces:
org.apache.commons.digester3.ObjectCreationFactory<Object>, IDigesterRuleAware, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware
Direct Known Subclasses:
JobFactory, ListenerFactory, ParameterFactory

public class GenericFactory extends AbstractSpringPoweredDigesterFactory
Generic factory for instantiating beans from the Digester framework.

This factory uses the name of the current element for name of the bean, instead of hard-wiring a bean name. The name of current element is prefixed with the string "proto-", to prevent unwanted auto-wiring cascaded of other prototype beans defined in the Spring Factory which are supposed to be defined in the IBIS Configuration File.

If a className attribute is specified in the configuration file, then this is used together with the bean-name to find the bean to be instantiated from the Spring Factory (see the rules laid out in AbstractSpringPoweredDigesterFactory. In particular, the bean-name is ignored when the class-name is specified and the Spring Factory contains exactly 1 bean-definition for that class.

This is useful for those kinds of rules in the digester-rules.xml where the className was always mandatory in older versions, but also for those rules where className is never specified and only 1 possible implementation exists.

NB: The Apache Digester cannot read a factory-create-rule from XML and supply parameters to the factory created from the XML digester-rules, so there is no way to configure a factory instance with a bean-name from the digester-rules.

Tim van der Leeuw