Package org.apache.camel.component.bean
Class ConstantTypeBeanHolder
- java.lang.Object
-
- org.apache.camel.component.bean.ConstantTypeBeanHolder
-
- All Implemented Interfaces:
BeanHolder,BeanTypeHolder
- Direct Known Subclasses:
ConstantStaticTypeBeanHolder
public class ConstantTypeBeanHolder extends Object implements BeanTypeHolder
A constant (singleton) bean implementation ofBeanTypeHolder
-
-
Constructor Summary
Constructors Constructor Description ConstantTypeBeanHolder(Class<?> type, org.apache.camel.CamelContext context, ParameterMappingStrategy parameterMappingStrategy, BeanComponent beanComponent)ConstantTypeBeanHolder(Class<?> type, BeanInfo beanInfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConstantBeanHoldercreateCacheHolder()Creates a cached and constantBeanHolderfrom this holder.ObjectgetBean(org.apache.camel.Exchange exchange)Gets the bean.BeanInfogetBeanInfo()Gets bean info for the bean.BeanInfogetBeanInfo(Object bean)Gets bean info for the given bean.Map<String,Object>getOptions()Additional options that should be configured on the beanorg.apache.camel.ProcessorgetProcessor()Gets aProcessorfor this bean, if supported.Class<?>getType()voidsetErrorHandler(org.apache.camel.Processor errorHandler)Sets error handler used by @RecipientList EIPvoidsetOptions(Map<String,Object> options)Sets additional options that should be configured on the beanbooleansupportProcessor()Whether aProcessoris supported by this bean holder.StringtoString()
-
-
-
Constructor Detail
-
ConstantTypeBeanHolder
public ConstantTypeBeanHolder(Class<?> type, org.apache.camel.CamelContext context, ParameterMappingStrategy parameterMappingStrategy, BeanComponent beanComponent)
-
-
Method Detail
-
setErrorHandler
public void setErrorHandler(org.apache.camel.Processor errorHandler)
Description copied from interface:BeanHolderSets error handler used by @RecipientList EIP- Specified by:
setErrorHandlerin interfaceBeanHolder- Parameters:
errorHandler- the error handler
-
getOptions
public Map<String,Object> getOptions()
Description copied from interface:BeanHolderAdditional options that should be configured on the bean- Specified by:
getOptionsin interfaceBeanHolder
-
setOptions
public void setOptions(Map<String,Object> options)
Description copied from interface:BeanHolderSets additional options that should be configured on the bean- Specified by:
setOptionsin interfaceBeanHolder
-
createCacheHolder
public ConstantBeanHolder createCacheHolder()
Creates a cached and constantBeanHolderfrom this holder.- Returns:
- a new
BeanHolderthat has cached the lookup of the bean.
-
getBean
public Object getBean(org.apache.camel.Exchange exchange)
Description copied from interface:BeanHolderGets the bean.- Specified by:
getBeanin interfaceBeanHolder
-
getProcessor
public org.apache.camel.Processor getProcessor()
Description copied from interface:BeanHolderGets aProcessorfor this bean, if supported.- Specified by:
getProcessorin interfaceBeanHolder- Returns:
- the
Processor, or null if not supported.
-
supportProcessor
public boolean supportProcessor()
Description copied from interface:BeanHolderWhether aProcessoris supported by this bean holder.- Specified by:
supportProcessorin interfaceBeanHolder- Returns:
- true if the holder can supporting using a processor, false otherwise
-
getBeanInfo
public BeanInfo getBeanInfo()
Description copied from interface:BeanHolderGets bean info for the bean.- Specified by:
getBeanInfoin interfaceBeanHolder
-
getBeanInfo
public BeanInfo getBeanInfo(Object bean)
Description copied from interface:BeanHolderGets bean info for the given bean. This implementation allows a thread safe usage forBeanHolderimplementations such as theRegistryBean.- Specified by:
getBeanInfoin interfaceBeanHolder- Parameters:
bean- the bean- Returns:
- null if not supported, then use
BeanHolder.getBeanInfo()instead.
-
getType
public Class<?> getType()
- Specified by:
getTypein interfaceBeanTypeHolder
-
-