Package org.apache.camel.component.bean
Class RegistryBean
java.lang.Object
org.apache.camel.component.bean.RegistryBean
- All Implemented Interfaces:
BeanHolder
An implementation of a
BeanHolder which will look up a bean from the registry and act as a cache of its
metadata-
Constructor Summary
ConstructorsConstructorDescriptionRegistryBean(org.apache.camel.CamelContext context, String name, ParameterMappingStrategy parameterMappingStrategy, BeanComponent beanComponent) -
Method Summary
Modifier and TypeMethodDescriptionprotected BeanInfocreateBeanInfo(Object bean) Creates a singleton (cached and constant)BeanHolderfrom this holder.getBean(org.apache.camel.Exchange exchange) Gets the bean.Gets bean info for the bean.getBeanInfo(Object bean) Gets bean info for the given bean.org.apache.camel.CamelContextgetName()Additional options that should be configured on the beanorg.apache.camel.ProcessorGets aProcessorfor this bean, if supported.org.apache.camel.spi.Registryprotected ObjectvoidsetErrorHandler(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 beanbooleanWhether aProcessoris supported by this bean holder.toString()
-
Constructor Details
-
RegistryBean
public RegistryBean(org.apache.camel.CamelContext context, String name, ParameterMappingStrategy parameterMappingStrategy, BeanComponent beanComponent)
-
-
Method Details
-
toString
-
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
Description copied from interface:BeanHolderAdditional options that should be configured on the bean- Specified by:
getOptionsin interfaceBeanHolder
-
setOptions
Description copied from interface:BeanHolderSets additional options that should be configured on the bean- Specified by:
setOptionsin interfaceBeanHolder
-
createCacheHolder
Creates a singleton (cached and constant)BeanHolderfrom this holder. -
getBean
public Object getBean(org.apache.camel.Exchange exchange) throws org.apache.camel.NoSuchBeanException Description copied from interface:BeanHolderGets the bean.- Specified by:
getBeanin 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: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
Description copied from interface:BeanHolderGets bean info for the bean.- Specified by:
getBeanInfoin interfaceBeanHolder
-
getBeanInfo
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.
-
getName
-
getRegistry
public org.apache.camel.spi.Registry getRegistry() -
getContext
public org.apache.camel.CamelContext getContext() -
createBeanInfo
-
lookupBean
-