public interface RouteTemplateContext extends HasCamelContext
Route
from a route template.Modifier and Type | Interface and Description |
---|---|
static interface |
RouteTemplateContext.BeanSupplier<T>
Used for template beans to supply the local bean the route template should use when creating route(s).
|
Modifier and Type | Method and Description |
---|---|
void |
bind(String id,
Class<?> type,
Object bean)
Binds the bean to the repository (if possible).
|
void |
bind(String id,
Class<?> type,
Supplier<Object> bean)
Binds the bean (via a supplier) to the repository (if possible).
|
default void |
bind(String id,
Object bean)
Binds the bean to the repository (if possible).
|
void |
bindAsPrototype(String id,
Class<?> type,
Supplier<Object> bean)
Binds the bean (via a supplier) to the repository (if possible).
|
Consumer<RouteTemplateContext> |
getConfigurer()
Gets the custom configurer.
|
BeanRepository |
getLocalBeanRepository()
Gets the local bean repository for the route template when creating the new route
|
Map<String,Object> |
getParameters()
The parameters to use for the route template when creating the new route
|
Object |
getProperty(String name)
Gets the property with the given name
|
<T> T |
getProperty(String name,
Class<?> type)
Gets the property with the given name
|
void |
setConfigurer(Consumer<RouteTemplateContext> configurer)
Sets a custom configurer which allows to do configuration while the route template is being used to create a
route.
|
void |
setParameter(String name,
Object value)
Sets a parameter
|
getCamelContext
default void bind(String id, Object bean)
CamelContextAware
then the registry will automatic inject the context if possible.id
- the id of the beanbean
- the beanvoid bind(String id, Class<?> type, Object bean)
CamelContextAware
then the registry will automatic inject the context if possible.id
- the id of the beantype
- the type of the bean to associate the bindingbean
- the beanvoid bind(String id, Class<?> type, Supplier<Object> bean)
bindAsPrototype(String, Class, Supplier)
instead.
Binding by id and type allows to bind multiple entries with the same id but with different type.
If the bean is CamelContextAware
then the registry will automatic inject the context if possible.id
- the id of the beantype
- the type of the bean to associate the bindingbean
- a supplier for the beanvoid bindAsPrototype(String id, Class<?> type, Supplier<Object> bean)
CamelContextAware
then the registry will automatic inject the context if possible.id
- the id of the beantype
- the type of the bean to associate the bindingbean
- a supplier for the beanObject getProperty(String name)
name
- name of property<T> T getProperty(String name, Class<?> type)
name
- name of propertytype
- the type of the propertyTypeConversionException
- is thrown if error during type conversionvoid setParameter(String name, Object value)
name
- the parameter namevalue
- the parameter valueMap<String,Object> getParameters()
BeanRepository getLocalBeanRepository()
void setConfigurer(Consumer<RouteTemplateContext> configurer)
configurer
- the configurer with callback to invoke with the given route template contextConsumer<RouteTemplateContext> getConfigurer()
Apache Camel