/** * Recreate the invocation result contained in the given RemoteInvocationResult object. * <p>The default implementation calls the default {@code recreate()} method. * This can be overridden in subclass to provide custom recreation, potentially * processing the returned result object. * @param result the RemoteInvocationResult to recreate * @return a return value if the invocation result is a successful return * @throws Throwable if the invocation result is an exception * @see RemoteInvocationResult#recreate() */ protected Object recreateRemoteInvocationResult(RemoteInvocationResult result) throws Throwable { return result.recreate(); }
/** * Recreate the invocation result contained in the given RemoteInvocationResult object. * <p>The default implementation calls the default {@code recreate()} method. * This can be overridden in subclass to provide custom recreation, potentially * processing the returned result object. * @param result the RemoteInvocationResult to recreate * @return a return value if the invocation result is a successful return * @throws Throwable if the invocation result is an exception * @see RemoteInvocationResult#recreate() */ protected Object recreateRemoteInvocationResult(RemoteInvocationResult result) throws Throwable { return result.recreate(); }
/** * Recreate the invocation result contained in the given {@link RemoteInvocationResult} * object. * <p>The default implementation calls the default {@code recreate()} method. * <p>Can be overridden in subclasses to provide custom recreation, potentially * processing the returned result object. * @param result the RemoteInvocationResult to recreate * @return a return value if the invocation result is a successful return * @throws Throwable if the invocation result is an exception * @see org.springframework.remoting.support.RemoteInvocationResult#recreate() */ @Nullable protected Object recreateRemoteInvocationResult(RemoteInvocationResult result) throws Throwable { return result.recreate(); }
/** * Recreate the invocation result contained in the given RemoteInvocationResult * object. The default implementation calls the default recreate method. * <p>Can be overridden in subclass to provide custom recreation, potentially * processing the returned result object. * @param result the RemoteInvocationResult to recreate * @return a return value if the invocation result is a successful return * @throws Throwable if the invocation result is an exception * @see org.springframework.remoting.support.RemoteInvocationResult#recreate() */ protected Object recreateRemoteInvocationResult(RemoteInvocationResult result) throws Throwable { return result.recreate(); }
/** * Recreate the invocation result contained in the given RemoteInvocationResult object. * <p>The default implementation calls the default {@code recreate()} method. * This can be overridden in subclass to provide custom recreation, potentially * processing the returned result object. * @param result the RemoteInvocationResult to recreate * @return a return value if the invocation result is a successful return * @throws Throwable if the invocation result is an exception * @see RemoteInvocationResult#recreate() */ protected Object recreateRemoteInvocationResult(RemoteInvocationResult result) throws Throwable { return result.recreate(); }
/** * Recreate the invocation result contained in the given {@link RemoteInvocationResult} * object. * <p>The default implementation calls the default {@code recreate()} method. * <p>Can be overridden in subclasses to provide custom recreation, potentially * processing the returned result object. * @param result the RemoteInvocationResult to recreate * @return a return value if the invocation result is a successful return * @throws Throwable if the invocation result is an exception * @see org.springframework.remoting.support.RemoteInvocationResult#recreate() */ protected Object recreateRemoteInvocationResult(RemoteInvocationResult result) throws Throwable { return result.recreate(); }
/** * Recreate the invocation result contained in the given * RemoteInvocationResult object. The default implementation calls the * default recreate method. * <p> * Can be overridden in subclass to provide custom recreation, potentially * processing the returned result object. * * @param result * the RemoteInvocationResult to recreate * @return a return value if the invocation result is a successful return * @throws Throwable * if the invocation result is an exception * @see org.springframework.remoting.support.RemoteInvocationResult#recreate */ protected Object recreateRemoteInvocationResult(RemoteInvocationResult result) throws Throwable { return result.recreate(); }
/** * Recreate the invocation result contained in the given {@link RemoteInvocationResult} * object. * <p>The default implementation calls the default {@code recreate()} method. * <p>Can be overridden in subclasses to provide custom recreation, potentially * processing the returned result object. * @param result the RemoteInvocationResult to recreate * @return a return value if the invocation result is a successful return * @throws Throwable if the invocation result is an exception * @see org.springframework.remoting.support.RemoteInvocationResult#recreate() */ @Nullable protected Object recreateRemoteInvocationResult(RemoteInvocationResult result) throws Throwable { return result.recreate(); }
@Override public Object fromMessage(Message message) throws MessageConversionException { Object result = this.delegate.fromMessage(message); if (result instanceof RemoteInvocationResult) { try { result = ((RemoteInvocationResult) result).recreate(); if (result == null) { throw new MessageConversionException("RemoteInvocationResult returned null"); } } catch (Throwable e) { // NOSONAR throw new AmqpRemoteException(e); } } return result; }
@Override public Object invoke(MethodInvocation invocation) throws Throwable { RemoteInvocation remoteInvocation = getRemoteInvocationFactory().createRemoteInvocation(invocation); Object rawResult; if (getRoutingKey() == null) { // Use the template's default routing key rawResult = this.amqpTemplate.convertSendAndReceive(remoteInvocation); } else { rawResult = this.amqpTemplate.convertSendAndReceive(this.routingKey, remoteInvocation); } if (rawResult == null) { throw new RemoteProxyFailureException("No reply received from '" + remoteInvocation.getMethodName() + "' with arguments '" + Arrays.asList(remoteInvocation.getArguments()) + // NOSONAR (null) "' - perhaps a timeout in the template?", null); } else if (!(rawResult instanceof RemoteInvocationResult)) { throw new RemoteProxyFailureException("Expected a result of type " + RemoteInvocationResult.class.getCanonicalName() + " but found " + rawResult.getClass().getCanonicalName(), null); // NOSONAR (null) } RemoteInvocationResult result = (RemoteInvocationResult) rawResult; return result.recreate(); }