Interface CamelBeanPostProcessor


  • public interface CamelBeanPostProcessor
    Bean post processor.
    • Method Detail

      • postProcessBeforeInitialization

        default Object postProcessBeforeInitialization​(Object bean,
                                                       String beanName)
                                                throws Exception
        Apply this post processor to the given new bean instance before any bean initialization callbacks (like afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.
        Parameters:
        bean - the new bean instance
        beanName - the name of the bean
        Returns:
        the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
        Throws:
        Exception - is thrown if error post processing bean
      • postProcessAfterInitialization

        default Object postProcessAfterInitialization​(Object bean,
                                                      String beanName)
                                               throws Exception
        Apply this post processor to the given new bean instance after any bean initialization callbacks (like afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.
        Parameters:
        bean - the new bean instance
        beanName - the name of the bean
        Returns:
        the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked
        Throws:
        Exception - is thrown if error post processing bean
      • setEnabled

        default void setEnabled​(boolean enabled)
        Can be used to turn off bean post processing. Be careful to turn this off, as this means that beans that use Camel annotations such as EndpointInject, ProducerTemplate, Produce, Consume etc will not be injected and in use. Turning this off should only be done if you are sure you do not use any of these Camel features.
      • isEnabled

        default boolean isEnabled()
      • setUnbindEnabled

        default void setUnbindEnabled​(boolean unbindEnabled)
      • isUnbindEnabled

        default boolean isUnbindEnabled()
        Can be used to unbind any existing beans before binding a bean to the registry. Be careful to enable this, as this will unbind all beans with the given id. This is used in special use-cases such as reloading of Camel routes which triggered updating beans that have their implementation re-compiled and re-loaded.
      • addCamelBeanPostProjectInjector

        default void addCamelBeanPostProjectInjector​(CamelBeanPostProcessorInjector injector)
        Adds a custom bean post injector
        Parameters:
        injector - the custom injector