Package org.apache.camel.component.bean
Class AbstractCamelInvocationHandler
java.lang.Object
org.apache.camel.component.bean.AbstractCamelInvocationHandler
- All Implemented Interfaces:
InvocationHandler
- Direct Known Subclasses:
CamelInvocationHandler
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractCamelInvocationHandler
(org.apache.camel.Endpoint endpoint, org.apache.camel.Producer producer) -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
afterInvoke
(Method method, org.apache.camel.Exchange exchange, boolean isFuture) protected Object
abstract Object
doInvokeProxy
(Object proxy, Method method, Object[] args) protected Throwable
findSuitableException
(Throwable cause, Method method) Tries to find the best suited exception to throw.protected static ExecutorService
getExecutorService
(org.apache.camel.CamelContext context) protected static Class<?>
getGenericType
(org.apache.camel.CamelContext context, Type type) final Object
protected Object
invokeProxy
(Method method, org.apache.camel.ExchangePattern pattern, Object[] args, boolean binding) protected Object
invokeWithBody
(Method method, Object body, org.apache.camel.ExchangePattern pattern) protected boolean
isValidMethod
(Method method)
-
Field Details
-
endpoint
protected final org.apache.camel.Endpoint endpoint -
producer
protected final org.apache.camel.Producer producer
-
-
Constructor Details
-
AbstractCamelInvocationHandler
protected AbstractCamelInvocationHandler(org.apache.camel.Endpoint endpoint, org.apache.camel.Producer producer)
-
-
Method Details
-
invoke
- Specified by:
invoke
in interfaceInvocationHandler
- Throws:
Throwable
-
doInvokeProxy
- Throws:
Throwable
-
invokeProxy
protected Object invokeProxy(Method method, org.apache.camel.ExchangePattern pattern, Object[] args, boolean binding) throws Throwable - Throws:
Throwable
-
invokeWithBody
protected Object invokeWithBody(Method method, Object body, org.apache.camel.ExchangePattern pattern) throws Throwable - Throws:
Throwable
-
doInvoke
- Throws:
Throwable
-
afterInvoke
protected Object afterInvoke(Method method, org.apache.camel.Exchange exchange, boolean isFuture) throws Exception - Throws:
Exception
-
getGenericType
protected static Class<?> getGenericType(org.apache.camel.CamelContext context, Type type) throws ClassNotFoundException - Throws:
ClassNotFoundException
-
getExecutorService
-
findSuitableException
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
-
isValidMethod
-