org.apache.camel.component.bean
Class RegistryBean

java.lang.Object
  extended by org.apache.camel.component.bean.RegistryBean
All Implemented Interfaces:
BeanHolder

public class RegistryBean
extends Object
implements BeanHolder

An implementation of a BeanHolder which will look up a bean from the registry and act as a cache of its metadata

Version:

Constructor Summary
RegistryBean(CamelContext context, String name)
           
RegistryBean(Registry registry, CamelContext context, String name)
           
 
Method Summary
protected  BeanInfo createBeanInfo(Object bean)
           
 ConstantBeanHolder createCacheHolder()
           
protected  ParameterMappingStrategy createParameterMappingStrategy()
           
 Object getBean()
          Gets the bean.
 BeanInfo getBeanInfo()
          Gets bean info for the bean.
 BeanInfo getBeanInfo(Object bean)
          Gets bean info for the given bean.
 CamelContext getContext()
           
 String getName()
           
 ParameterMappingStrategy getParameterMappingStrategy()
           
 Processor getProcessor()
          Gets a Processor for this bean, if supported.
 Registry getRegistry()
           
protected  Object lookupBean()
           
 void setParameterMappingStrategy(ParameterMappingStrategy parameterMappingStrategy)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RegistryBean

public RegistryBean(CamelContext context,
                    String name)

RegistryBean

public RegistryBean(Registry registry,
                    CamelContext context,
                    String name)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

createCacheHolder

public ConstantBeanHolder createCacheHolder()
                                     throws Exception
Throws:
Exception

getBean

public Object getBean()
               throws NoSuchBeanException
Description copied from interface: BeanHolder
Gets the bean.

Specified by:
getBean in interface BeanHolder
Throws:
NoSuchBeanException - is thrown if the bean cannot be found.

getProcessor

public Processor getProcessor()
Description copied from interface: BeanHolder
Gets a Processor for this bean, if supported.

Specified by:
getProcessor in interface BeanHolder
Returns:
the Processor, or null if not supported.

getBeanInfo

public BeanInfo getBeanInfo()
Description copied from interface: BeanHolder
Gets bean info for the bean.

Specified by:
getBeanInfo in interface BeanHolder

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 for BeanHolder implementations such as the RegistryBean.

Specified by:
getBeanInfo in interface BeanHolder
Parameters:
bean - the bean
Returns:
null if not supported, then use BeanHolder.getBeanInfo() instead.

getName

public String getName()

getRegistry

public Registry getRegistry()

getContext

public CamelContext getContext()

getParameterMappingStrategy

public ParameterMappingStrategy getParameterMappingStrategy()

setParameterMappingStrategy

public void setParameterMappingStrategy(ParameterMappingStrategy parameterMappingStrategy)

createBeanInfo

protected BeanInfo createBeanInfo(Object bean)

createParameterMappingStrategy

protected ParameterMappingStrategy createParameterMappingStrategy()

lookupBean

protected Object lookupBean()


Apache CAMEL