public interface Registry extends BeanRepository
BeanRepository
which may also be capable of binding beans to its repository.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).
|
default Object |
wrap(Object value)
Strategy to wrap the value to be stored in the registry.
|
findByType, findByTypeWithName, lookupByName, lookupByNameAndType, unwrap
default void bind(String id, Object bean) throws RuntimeCamelException
CamelContextAware
then the registry will automatic inject the context if possible.id
- the id of the beanbean
- the beanRuntimeCamelException
- is thrown if binding is not possiblevoid bind(String id, Class<?> type, Object bean) throws RuntimeCamelException
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 beanRuntimeCamelException
- is thrown if binding is not possiblevoid bind(String id, Class<?> type, Supplier<Object> bean) throws RuntimeCamelException
bindAsPrototype(String, Class, Supplier)
instead.
Binding by id and type allows to bind multiple entries with the same id but with different type.id
- the id of the beantype
- the type of the bean to associate the bindingbean
- a supplier for the beanRuntimeCamelException
- is thrown if binding is not possiblevoid bindAsPrototype(String id, Class<?> type, Supplier<Object> bean) throws RuntimeCamelException
id
- the id of the beantype
- the type of the bean to associate the bindingbean
- a supplier for the beanRuntimeCamelException
- is thrown if binding is not possibleApache Camel