@SuppressWarnings("unchecked") public Message<Object> receive() { if (this.invoker == null) { this.afterPropertiesSet(); } try { Object result = this.invoker.invokeMethod(new Object[] {}); if (result == null) { return null; } if (result instanceof Message) { return (Message) result; } return new GenericMessage<Object>(result); } catch (InvocationTargetException e) { throw new MessagingException( "Source method '" + this.methodName + "' threw an Exception.", e.getTargetException()); } catch (Throwable e) { throw new MessagingException("Failed to invoke source method '" + this.methodName + "'."); } }