org.apache.camel.component.bean
Class BeanInfo

java.lang.Object
  extended by org.apache.camel.component.bean.BeanInfo

public class BeanInfo
extends Object

Represents the metadata about a bean type created via a combination of introspection and annotations together with some useful sensible defaults

Version:
$Revision: 904498 $

Constructor Summary
BeanInfo(CamelContext camelContext, Class<?> type)
           
BeanInfo(CamelContext camelContext, Class<?> type, ParameterMappingStrategy strategy)
           
 
Method Summary
protected  MethodInfo chooseMethod(Object pojo, Exchange exchange, String name)
          Lets try choose one of the available methods to invoke if we can match the message body to the body parameter
 MethodInvocation createInvocation(Method method, Object pojo, Exchange exchange)
           
 MethodInvocation createInvocation(Object pojo, Exchange exchange)
           
protected  MethodInfo createMethodInfo(Class clazz, Method method)
           
static ParameterMappingStrategy createParameterMappingStrategy(CamelContext camelContext)
           
 CamelContext getCamelContext()
           
 MethodInfo getMethodInfo(Method method)
          Returns the MethodInfo for the given method if it exists or null if there is no metadata available for the given method
 Class<?> getType()
           
protected  void introspect(Class<?> clazz)
          Introspects the given class
protected  MethodInfo introspect(Class<?> clazz, Method method)
          Introspects the given method
protected  boolean isValidMethod(Class<?> clazz, Method method)
          Validates whether the given method is a valid candidate for Camel Bean Binding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanInfo

public BeanInfo(CamelContext camelContext,
                Class<?> type)

BeanInfo

public BeanInfo(CamelContext camelContext,
                Class<?> type,
                ParameterMappingStrategy strategy)
Method Detail

getType

public Class<?> getType()

getCamelContext

public CamelContext getCamelContext()

createParameterMappingStrategy

public static ParameterMappingStrategy createParameterMappingStrategy(CamelContext camelContext)

createInvocation

public MethodInvocation createInvocation(Method method,
                                         Object pojo,
                                         Exchange exchange)

createInvocation

public MethodInvocation createInvocation(Object pojo,
                                         Exchange exchange)
                                  throws AmbiguousMethodCallException,
                                         MethodNotFoundException
Throws:
AmbiguousMethodCallException
MethodNotFoundException

introspect

protected void introspect(Class<?> clazz)
Introspects the given class

Parameters:
clazz - the class

introspect

protected MethodInfo introspect(Class<?> clazz,
                                Method method)
Introspects the given method

Parameters:
clazz - the class
method - the method
Returns:
the method info, is newer null

getMethodInfo

public MethodInfo getMethodInfo(Method method)
Returns the MethodInfo for the given method if it exists or null if there is no metadata available for the given method


createMethodInfo

protected MethodInfo createMethodInfo(Class clazz,
                                      Method method)

chooseMethod

protected MethodInfo chooseMethod(Object pojo,
                                  Exchange exchange,
                                  String name)
                           throws AmbiguousMethodCallException
Lets try choose one of the available methods to invoke if we can match the message body to the body parameter

Parameters:
pojo - the bean to invoke a method on
exchange - the message exchange
name - an optional name of the method that must match, use null to indicate all methods
Returns:
the method to invoke or null if no definitive method could be matched
Throws:
AmbiguousMethodCallException - is thrown if cannot chose method due to ambiguous

isValidMethod

protected boolean isValidMethod(Class<?> clazz,
                                Method method)
Validates whether the given method is a valid candidate for Camel Bean Binding.

Parameters:
clazz - the class
method - the method
Returns:
true if valid, false to skip the method


Copyright © 2007-2010 The Apache Software Foundation. All Rights Reserved.