Class CustomModelClassesRegistrar

java.lang.Object
org.openehealth.ipf.modules.hl7.config.CustomModelClassesRegistrar
All Implemented Interfaces:
Aware, BeanFactoryAware, SmartInitializingSingleton

public class CustomModelClassesRegistrar extends Object implements BeanFactoryAware, SmartInitializingSingleton
Collects the CustomModelClasses beans of the application context and adds their package definitions to the CustomModelClassFactory instances in use. A single bean declaration is enough:
    <bean class="org.openehealth.ipf.modules.hl7.config.CustomModelClassesRegistrar"/>
If setCustomModelClassFactory(CustomModelClassFactory) is not set, all CustomModelClassFactory beans of the application context are configured -- which is what makes this work out of the box in Spring Boot, where the factory bean is contributed by auto-configuration and frequently replaced by the application.

Collecting happens in afterSingletonsInstantiated(), i.e. before the ContextRefreshedEvent and thus well before any HL7v2 message is parsed.

This replaces the deprecated CustomModelClassFactoryConfigurer.

Since:
6.0
Author:
Christian Ohr