Package org.apache.camel.component.bean
Class RegistryBean
- java.lang.Object
-
- org.apache.camel.component.bean.RegistryBean
-
- All Implemented Interfaces:
BeanHolder
public class RegistryBean extends Object implements BeanHolder
An implementation of aBeanHolder
which will look up a bean from the registry and act as a cache of its metadata
-
-
Constructor Summary
Constructors Constructor Description RegistryBean(org.apache.camel.CamelContext context, String name, ParameterMappingStrategy parameterMappingStrategy, BeanComponent beanComponent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BeanInfo
createBeanInfo(Object bean)
ConstantBeanHolder
createCacheHolder()
Creates a singleton (cached and constant)BeanHolder
from this holder.Object
getBean(org.apache.camel.Exchange exchange)
Gets the bean.BeanInfo
getBeanInfo()
Gets bean info for the bean.BeanInfo
getBeanInfo(Object bean)
Gets bean info for the given bean.org.apache.camel.CamelContext
getContext()
String
getName()
Map<String,Object>
getOptions()
Additional options that should be configured on the beanorg.apache.camel.Processor
getProcessor()
Gets aProcessor
for this bean, if supported.org.apache.camel.spi.Registry
getRegistry()
protected Object
lookupBean()
void
setErrorHandler(org.apache.camel.Processor errorHandler)
Sets error handler used by @RecipientList EIPvoid
setOptions(Map<String,Object> options)
Sets additional options that should be configured on the beanboolean
supportProcessor()
Whether aProcessor
is supported by this bean holder.String
toString()
-
-
-
Constructor Detail
-
RegistryBean
public RegistryBean(org.apache.camel.CamelContext context, String name, ParameterMappingStrategy parameterMappingStrategy, BeanComponent beanComponent)
-
-
Method Detail
-
setErrorHandler
public void setErrorHandler(org.apache.camel.Processor errorHandler)
Description copied from interface:BeanHolder
Sets error handler used by @RecipientList EIP- Specified by:
setErrorHandler
in interfaceBeanHolder
- Parameters:
errorHandler
- the error handler
-
getOptions
public Map<String,Object> getOptions()
Description copied from interface:BeanHolder
Additional options that should be configured on the bean- Specified by:
getOptions
in interfaceBeanHolder
-
setOptions
public void setOptions(Map<String,Object> options)
Description copied from interface:BeanHolder
Sets additional options that should be configured on the bean- Specified by:
setOptions
in interfaceBeanHolder
-
createCacheHolder
public ConstantBeanHolder createCacheHolder()
Creates a singleton (cached and constant)BeanHolder
from this holder.
-
getBean
public Object getBean(org.apache.camel.Exchange exchange) throws org.apache.camel.NoSuchBeanException
Description copied from interface:BeanHolder
Gets the bean.- Specified by:
getBean
in interfaceBeanHolder
- Throws:
org.apache.camel.NoSuchBeanException
- is thrown if the bean cannot be found.
-
getProcessor
public org.apache.camel.Processor getProcessor()
Description copied from interface:BeanHolder
Gets aProcessor
for this bean, if supported.- Specified by:
getProcessor
in interfaceBeanHolder
- Returns:
- the
Processor
, or null if not supported.
-
supportProcessor
public boolean supportProcessor()
Description copied from interface:BeanHolder
Whether aProcessor
is supported by this bean holder.- Specified by:
supportProcessor
in interfaceBeanHolder
- Returns:
- true if the holder can supporting using a processor, false otherwise
-
getBeanInfo
public BeanInfo getBeanInfo()
Description copied from interface:BeanHolder
Gets bean info for the bean.- Specified by:
getBeanInfo
in interfaceBeanHolder
-
getBeanInfo
public BeanInfo getBeanInfo(Object bean)
Description copied from interface:BeanHolder
Gets bean info for the given bean. This implementation allows a thread safe usage forBeanHolder
implementations such as theRegistryBean
.- Specified by:
getBeanInfo
in interfaceBeanHolder
- Parameters:
bean
- the bean- Returns:
- null if not supported, then use
BeanHolder.getBeanInfo()
instead.
-
getName
public String getName()
-
getRegistry
public org.apache.camel.spi.Registry getRegistry()
-
getContext
public org.apache.camel.CamelContext getContext()
-
lookupBean
protected Object lookupBean()
-
-