MethodInvokingSource now returns null when the method invocation result is null.

This commit is contained in:
Mark Fisher
2008-08-05 19:50:14 +00:00
parent 0662b3edee
commit bbd7a12a4e

View File

@@ -60,7 +60,11 @@ public class MethodInvokingSource implements PollableSource<Object>, Initializin
this.afterPropertiesSet();
}
try {
return new GenericMessage<Object>(this.invoker.invokeMethod(new Object[] {}));
Object result = this.invoker.invokeMethod(new Object[] {});
if (result == null) {
return null;
}
return new GenericMessage<Object>(result);
} catch (InvocationTargetException e) {
throw new MessagingException(
"Source method '" + this.methodName + "' threw an Exception.", e.getTargetException());