Beispiel #1
0
    @Override
    public void close(Message message) throws IOException {
      if (Boolean.TRUE.equals(message.getExchange().get(LocalConduit.DIRECT_DISPATCH))) {
        final Exchange exchange = (Exchange) message.getExchange().get(LocalConduit.IN_EXCHANGE);

        MessageImpl copy = new MessageImpl();
        copy.putAll(message);
        MessageImpl.copyContent(message, copy);
        CachedOutputStream stream = (CachedOutputStream) message.getContent(OutputStream.class);
        copy.setContent(InputStream.class, stream.getInputStream());
        if (exchange != null && exchange.getInMessage() == null) {
          exchange.setInMessage(copy);
        }
        conduit.getMessageObserver().onMessage(copy);
        return;
      }

      super.close(message);
    }
 @Override
 public void close(Message msg) throws IOException {
   super.close(msg);
 }