コード例 #1
0
  protected void doInvokeAsynchronous(ProxyRequest proxyRequest, BaseProxyBean baseProxyBean) {

    SingleDestinationMessageSender messageSender =
        baseProxyBean.getSingleDestinationMessageSender();

    if (messageSender == null) {
      throw new IllegalStateException(
          "Asynchronous message sender was not configured properly for "
              + baseProxyBean.getClass().getName());
    }

    messageSender.send(proxyRequest);
  }
コード例 #2
0
  protected Object doInvokeSynchronous(ProxyRequest proxyRequest, BaseProxyBean baseProxyBean)
      throws Exception {

    SingleDestinationSynchronousMessageSender messageSender =
        baseProxyBean.getSingleDestinationSynchronousMessageSender();

    if (messageSender == null) {
      throw new IllegalStateException(
          "Synchronous message sender was not configured properly for "
              + baseProxyBean.getClass().getName());
    }

    ProxyResponse proxyResponse = (ProxyResponse) messageSender.send(proxyRequest);

    if (proxyResponse == null) {
      return null;
    } else if (proxyResponse.hasError()) {
      throw proxyResponse.getException();
    } else {
      return proxyResponse.getResult();
    }
  }