org.apache.camel.component.bean
Class CamelInvocationHandler
java.lang.Object
org.apache.camel.component.bean.CamelInvocationHandler
- All Implemented Interfaces:
- InvocationHandler
public class CamelInvocationHandler
- extends Object
- implements InvocationHandler
An InvocationHandler which invokes a
message exchange on a camel Endpoint
- Version:
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CamelInvocationHandler
public CamelInvocationHandler(Endpoint endpoint,
Producer producer,
MethodInfoCache methodInfoCache)
invoke
public Object invoke(Object proxy,
Method method,
Object[] args)
throws Throwable
- Specified by:
invoke in interface InvocationHandler
- Throws:
Throwable
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 exceptionmethod - the method
- Returns:
- the exception to throw, or null if not possible to find a suitable exception
Apache CAMEL