Class DynamicDependsOn

  • All Implemented Interfaces:
    org.springframework.beans.factory.config.BeanFactoryPostProcessor

    @Order(2147483647)
    @Component("webdevice.DynamicDependsOn")
    public class DynamicDependsOn
    extends Object
    implements org.springframework.beans.factory.config.BeanFactoryPostProcessor
    This class exists to establish dependencies that ensure proper lifecycle ordering between a WebDevice instance and all of the DeviceProvider instances present in the context. DeviceProvider instances are defined dynamically and not known at compile time, so DependsOn cannot be used.

    In all cases, the WebDevice must be destroyed before all other components so that it will release it's acquired Device to the originating DeviceProvider. Then the providers can be destroyed.

    • Constructor Detail

      • DynamicDependsOn

        public DynamicDependsOn()
    • Method Detail

      • postProcessBeanFactory

        public void postProcessBeanFactory​(org.springframework.beans.factory.config.ConfigurableListableBeanFactory factory)
                                    throws org.springframework.beans.BeansException
        Specified by:
        postProcessBeanFactory in interface org.springframework.beans.factory.config.BeanFactoryPostProcessor
        Throws:
        org.springframework.beans.BeansException