exchange.setInMessage(inMessage);
inMessage = new MessageImpl(); ExchangeImpl exchange = new ExchangeImpl(); exchange.setInMessage(inMessage); setupMessage(inMessage, config,
exchange.setInMessage(inMessage);
@Override public void invoke(final ServletConfig config, final ServletContext context, final HttpServletRequest req, final HttpServletResponse resp) throws IOException { // eager create the message to ensure we set our continuation for @Suspended Message inMessage = retrieveFromContinuation(req); if (inMessage == null) { inMessage = new MessageImpl(); final ExchangeImpl exchange = new ExchangeImpl(); exchange.setInMessage(inMessage); setupMessage(inMessage, config, context, req, resp); exchange.setSession(new HTTPSession(req)); MessageImpl.class.cast(inMessage).setDestination(this); } delegate.invoke(config, context, req, resp); }
exchange.setInMessage(inMessage); setupMessage(inMessage, context, req, resp);
inMessage = new MessageImpl(); ExchangeImpl exchange = new ExchangeImpl(); exchange.setInMessage(inMessage); setupMessage(inMessage, config,
public void onMessage(Message message) { try { // HTTP seems to need this right now... ExchangeImpl ex = new ExchangeImpl(); ex.setInMessage(message); Conduit backChannel = message.getDestination().getBackChannel(message); MessageImpl res = new MessageImpl(); ex.setOutMessage(res); res.put(Message.CONTENT_TYPE, "text/xml"); backChannel.prepare(res); OutputStream out = res.getContent(OutputStream.class); InputStream is = resource.openStream(); IOUtils.copy(is, out, 2048); out.flush(); out.close(); is.close(); backChannel.close(res); } catch (Exception e) { e.printStackTrace(); } }
inMessage = new MessageImpl(); ExchangeImpl exchange = new ExchangeImpl(); exchange.setInMessage(inMessage); setupMessage(inMessage, config,
public void run() { ExchangeImpl ex = new ExchangeImpl(); ex.put(Bus.class, destination.getBus()); ex.setInMessage(inMsg); inMsg.setExchange(ex); ex.put(IN_EXCHANGE, exchange); try { destination.getMessageObserver().onMessage(inMsg); } catch (Throwable t) { Message m = inMsg.getExchange().getOutFaultMessage(); if (m == null) { m = inMsg.getExchange().getOutMessage(); } if (m != null) { try { m.put(Message.RESPONSE_CODE, 500); m.put(Message.PROTOCOL_HEADERS, new HashMap<String, List<String>>()); m.getExchange().put(Message.RESPONSE_CODE, 500); m.getContent(OutputStream.class).close(); } catch (IOException e) { //ignore } } } } };
public void run() { ExchangeImpl ex = new ExchangeImpl(); ex.put(Bus.class, destination.getBus()); ex.setInMessage(inMsg); inMsg.setExchange(ex); ex.put(IN_EXCHANGE, exchange); try { destination.getMessageObserver().onMessage(inMsg); } catch (Throwable t) { Message m = inMsg.getExchange().getOutFaultMessage(); if (m == null) { m = inMsg.getExchange().getOutMessage(); } if (m != null) { try { m.put(Message.RESPONSE_CODE, 500); m.put(Message.PROTOCOL_HEADERS, new HashMap<String, List<String>>()); m.getExchange().put(Message.RESPONSE_CODE, 500); m.getContent(OutputStream.class).close(); } catch (IOException e) { //ignore } } } } };
private void dispatchDirect(Message message) throws IOException { if (destination.getMessageObserver() == null) { throw new IllegalStateException("Local destination does not have a MessageObserver on address " + destination.getAddress().getAddress().getValue()); } MessageImpl copy = new MessageImpl(); copy.put(IN_CONDUIT, this); copy.setDestination(destination); transportFactory.copy(message, copy); MessageImpl.copyContent(message, copy); OutputStream out = message.getContent(OutputStream.class); out.flush(); out.close(); CachedOutputStream stream = message.get(CachedOutputStream.class); copy.setContent(InputStream.class, stream.getInputStream()); copy.removeContent(CachedOutputStream.class); stream.releaseTempFileHold(); // Create a new incoming exchange and store the original exchange for the response ExchangeImpl ex = new ExchangeImpl(); ex.setInMessage(copy); ex.put(IN_EXCHANGE, message.getExchange()); ex.put(LocalConduit.DIRECT_DISPATCH, true); ex.setDestination(destination); destination.getMessageObserver().onMessage(copy); }
private void dispatchDirect(Message message) throws IOException { if (destination.getMessageObserver() == null) { throw new IllegalStateException("Local destination does not have a MessageObserver on address " + destination.getAddress().getAddress().getValue()); } MessageImpl copy = new MessageImpl(); copy.put(IN_CONDUIT, this); copy.setDestination(destination); transportFactory.copy(message, copy); MessageImpl.copyContent(message, copy); OutputStream out = message.getContent(OutputStream.class); out.flush(); out.close(); CachedOutputStream stream = message.get(CachedOutputStream.class); copy.setContent(InputStream.class, stream.getInputStream()); copy.removeContent(CachedOutputStream.class); stream.releaseTempFileHold(); // Create a new incoming exchange and store the original exchange for the response ExchangeImpl ex = new ExchangeImpl(); ex.setInMessage(copy); ex.put(IN_EXCHANGE, message.getExchange()); ex.put(LocalConduit.DIRECT_DISPATCH, true); ex.setDestination(destination); destination.getMessageObserver().onMessage(copy); }
exchange.setInMessage(getBinding().createMessage(message)); exchange.setSession(new HTTPSession(servletRequest));