Interface BeanProcessorFactory
public interface BeanProcessorFactory
Factory for creating a
Processor that invokes a method on a bean with full support for
Camel bean parameter bindings.
When a route contains a .bean() DSL call, Camel delegates processor creation to this factory. The factory
implementation lives in camel-bean (loaded via the META-INF service file convention) and supports resolving
the target bean from multiple sources: a direct instance, a registry reference by name, a class name, or a
Class literal. The method parameter may be omitted to let Camel auto-select the best matching method
using the bean-binding algorithm.
The scope parameter controls bean lifecycle: BeanScope.Singleton reuses one shared
instance, while BeanScope.Prototype creates a new instance per exchange.- Since:
- 3.0
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptioncreateBeanProcessor(CamelContext camelContext, @Nullable Object bean, @Nullable String beanType, @Nullable Class<?> beanClass, @Nullable String ref, @Nullable String method, BeanScope scope) Creates the bean processor from a given set of parameters that can refer to the bean via an existing bean, a reference to a bean, or its class name etc.createBeanProcessor(CamelContext camelContext, Object bean, Method method) Creates the bean processor from the existing bean instance
-
Field Details
-
FACTORY
-
-
Method Details
-
createBeanProcessor
Processor createBeanProcessor(CamelContext camelContext, Object bean, Method method) throws Exception Creates the bean processor from the existing bean instance- Parameters:
camelContext- the camel contextbean- the beanmethod- the method to invoke- Returns:
- the created processor
- Throws:
Exception- is thrown if error creating the processor
-
createBeanProcessor
Processor createBeanProcessor(CamelContext camelContext, @Nullable Object bean, @Nullable String beanType, @Nullable Class<?> beanClass, @Nullable String ref, @Nullable String method, BeanScope scope) throws Exception Creates the bean processor from a given set of parameters that can refer to the bean via an existing bean, a reference to a bean, or its class name etc.- Parameters:
camelContext- the camel contextbean- the bean instancebeanType- or the bean class namebeanClass- or the bean classref- or bean reference to look up the bean from the registrymethod- optional name of method to invokescope- the scope of the bean- Returns:
- the created processor
- Throws:
Exception- is thrown if error creating the processor
-