Class ComponentServicePostProcessor

  • All Implemented Interfaces:
    EventListener, org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>

    public class ComponentServicePostProcessor
    extends Object
    implements org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
    ApplicationListener that retrieves beans with the annotation annotationClassOfBean e.g. @PipService from the created applicationContext to register them as components at the PMP.
    • Constructor Detail

      • ComponentServicePostProcessor

        public ComponentServicePostProcessor​(de.fraunhofer.iese.mydata.component.ComponentType type,
                                             Class<? extends java.lang.annotation.Annotation> annotationClassOfBean,
                                             IMyDataEnvironment myDataEnvironment,
                                             String serverUrl,
                                             String servletContextPath,
                                             String pathPrefix,
                                             @Nullable
                                             RestExposeHelper restExposeHelper)
        Parameters:
        type - Type of the components to create.
        annotationClassOfBean - Annotation that each service bean has.
        myDataEnvironment - The IMyDataEnvironment the components should be registered to
        serverUrl -
        servletContextPath -
        pathPrefix -
        restExposeHelper - the RestExposeHelper bean
    • Method Detail

      • onApplicationEvent

        public void onApplicationEvent​(org.springframework.context.event.ContextRefreshedEvent event)
        Listening to the event that is generated after context is refreshed (after creation).
        Specified by:
        onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
        Parameters:
        event - Contains the applicationContext that should be discovered.
        See Also:
        ApplicationListener.onApplicationEvent(ApplicationEvent)