Method invocation for namespace-based handlers now falls back to the Message as method parameter instead of passing the Message payload if the first invocation attempt throws a NoSuchMethodException (INT-216).

This commit is contained in:
Mark Fisher
2008-05-16 14:38:36 +00:00
parent f2186b815c
commit 71532737e2

View File

@@ -157,12 +157,20 @@ public abstract class AbstractMessageHandlerAdapter implements MessageHandler, I
args = new Object[] { mappingResult };
}
try {
Object result = this.invoker.invokeMethod(args);
Object result = null;
try {
result = this.invoker.invokeMethod(args);
}
catch (NoSuchMethodException e) {
result = this.invoker.invokeMethod(message);
this.methodExpectsMessage = true;
}
if (result == null) {
return null;
}
return this.handleReturnValue(result, message);
} catch (InvocationTargetException e) {
}
catch (InvocationTargetException e) {
throw new MessagingException(
"Handler method '" + this.method + "' threw an Exception.", e.getTargetException());
}