org.apache.camel.component.bean
Class AbstractCamelInvocationHandler

java.lang.Object
  extended by org.apache.camel.component.bean.AbstractCamelInvocationHandler
All Implemented Interfaces:
InvocationHandler
Direct Known Subclasses:
CamelInvocationHandler, PojoMessageInvocationHandler

public abstract class AbstractCamelInvocationHandler
extends Object
implements InvocationHandler


Field Summary
protected  Endpoint endpoint
           
protected  Producer producer
           
 
Constructor Summary
AbstractCamelInvocationHandler(Endpoint endpoint, Producer producer)
           
 
Method Summary
protected  Object afterInvoke(Method method, Exchange exchange, ExchangePattern pattern, boolean isFuture)
           
protected  Throwable findSuitableException(Throwable cause, Method method)
          Tries to find the best suited exception to throw.
protected static ExecutorService getExecutorService(CamelContext context)
           
protected static Class<?> getGenericType(CamelContext context, Type type)
           
protected  Object invokeWithbody(Method method, Object body, ExchangePattern pattern)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.reflect.InvocationHandler
invoke
 

Field Detail

endpoint

protected final Endpoint endpoint

producer

protected final Producer producer
Constructor Detail

AbstractCamelInvocationHandler

public AbstractCamelInvocationHandler(Endpoint endpoint,
                                      Producer producer)
Method Detail

invokeWithbody

protected Object invokeWithbody(Method method,
                                Object body,
                                ExchangePattern pattern)
                         throws InterruptedException,
                                Throwable
Throws:
InterruptedException
Throwable

afterInvoke

protected Object afterInvoke(Method method,
                             Exchange exchange,
                             ExchangePattern pattern,
                             boolean isFuture)
                      throws Exception
Throws:
Exception

getGenericType

protected static Class<?> getGenericType(CamelContext context,
                                         Type type)
                                  throws ClassNotFoundException
Throws:
ClassNotFoundException

getExecutorService

protected static ExecutorService getExecutorService(CamelContext context)

findSuitableException

protected Throwable findSuitableException(Throwable cause,
                                          Method method)
Tries to find the best suited exception to throw.

It looks in the exception hierarchy from the caused exception and matches this against the declared exceptions being thrown on the method.

Parameters:
cause - the caused exception
method - the method
Returns:
the exception to throw, or null if not possible to find a suitable exception


Apache CAMEL