Interface CamelDependencyInjectionAnnotationFactory


public interface CamelDependencyInjectionAnnotationFactory
Factory that creates the task carrying out a Camel dependency-injection annotation, such as binding a BindToRegistry bean into the Registry.

During CamelBeanPostProcessor bean post-processing, when a BindToRegistry annotation is found this factory produces a Runnable that performs the actual binding, including any optional init and destroy methods. Decoupling the binding into a task lets runtimes (such as Spring or Quarkus) control exactly when and how beans are registered, rather than binding eagerly during the scan.

See Bean Integration in the Camel user manual.

Since:
3.16
See Also:
  • Method Details

    • createBindToRegistryFactory

      Runnable createBindToRegistryFactory(String id, Object bean, Class<?> beanType, String beanName, boolean beanPostProcess, String initMethod, String destroyMethod)
      The task for binding the bean to the registry (eg annotation
      Parameters:
      id - the bean id
      bean - the bean instance
      beanType - the bean type (optional)
      beanName - the bean name
      beanPostProcess - whether bean post processor should be performed
      initMethod - optional init method (invoked at bind)
      destroyMethod - optional destroy method (invoked at unbind or stopping Camel)
      Returns:
      the created task to use for binding the bean