ExchangeImpl exchange = new ExchangeImpl(); exchange.setInMessage(inMessage);
private void updateClientPolicy() { if (!clientSidePolicyCalced) { //do no spend time on building Message and Exchange (which basically //are ConcurrentHashMap instances) if the policy is already available Message m = new MessageImpl(); m.setExchange(new ExchangeImpl()); m.getExchange().put(EndpointInfo.class, this.endpointInfo); updateClientPolicy(m); } }
LOG.fine("Create a new message for processing"); inMessage = new MessageImpl(); ExchangeImpl exchange = new ExchangeImpl(); exchange.setInMessage(inMessage); setupMessage(inMessage,
Object invoke(OperationInfo oi, ProtocolVariation protocol, Object[] params, Map<String, Object> context, Level level) throws RMException { return invoke(oi, protocol, params, context, new ExchangeImpl(), level); } Object invoke(OperationInfo oi, ProtocolVariation protocol, Object[] params) throws RMException {
inMessage.setExchange(new ExchangeImpl()); inMessage.getExchange().put(Bus.class, bus); inMessage.put(Message.DECOUPLED_CHANNEL_MESSAGE, Boolean.TRUE);
@Override public SoapResponse consume(SoapRequest request, MessageDispatcher dispatcher) { requireNonNull(dispatcher, "Message Dispatcher cannot be null"); String operation = request.getOperation(); Exchange exchange = new ExchangeImpl(); Object[] response = invoke(request, exchange, dispatcher); return responseGenerator.generate(operation, response, exchange); }
private void updateClientPolicy() { if (!clientSidePolicyCalced) { //do no spend time on building Message and Exchange (which basically //are ConcurrentHashMap instances) if the policy is already available Message m = new MessageImpl(); m.setExchange(new ExchangeImpl()); m.getExchange().put(EndpointInfo.class, this.endpointInfo); updateClientPolicy(m); } }
private MessageImpl createMessage(Endpoint e, Bus b) { MessageImpl m = new MessageImpl(); Exchange ex = new ExchangeImpl(); m.setExchange(ex); ex.put(Endpoint.class, e); ex.put(Bus.class, b); ex.put(Service.class, e.getService()); return m; }
private MessageImpl createMessage(Endpoint e, Bus b) { MessageImpl m = new MessageImpl(); Exchange ex = new ExchangeImpl(); m.setExchange(ex); ex.put(Endpoint.class, e); ex.put(Bus.class, b); ex.put(Service.class, e.getService()); return m; }
@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); }
public Conduit getConduit() { Message message = new MessageImpl(); Exchange exchange = new ExchangeImpl(); message.setExchange(exchange); message.putAll(getRequestContext()); setExchangeProperties(exchange, getEndpoint(), null); return getConduitSelector().selectConduit(message); }
public Conduit getConduit() { Message message = new MessageImpl(); Exchange exchange = new ExchangeImpl(); message.setExchange(exchange); message.putAll(getRequestContext()); setExchangeProperties(exchange, getEndpoint(), null); return getConduitSelector().selectConduit(message); }
public Conduit getConduit() { Message message = new MessageImpl(); Exchange exchange = new ExchangeImpl(); message.setExchange(exchange); message.putAll(getRequestContext()); setExchangeProperties(exchange, getEndpoint(), null); return getConduitSelector().selectConduit(message); }
public Conduit getConduit() { Message message = new MessageImpl(); Exchange exchange = new ExchangeImpl(); message.setExchange(exchange); message.putAll(getRequestContext()); setExchangeProperties(exchange, getEndpoint(), null); return getConduitSelector().selectConduit(message); }
protected void processStreamIo(IoSession session, InputStream in, OutputStream out) { final MessageImpl m = new MessageImpl(); final Exchange exchange = new ExchangeImpl(); exchange.setDestination(UDPDestination.this); m.setDestination(UDPDestination.this); exchange.setInMessage(m); m.setContent(InputStream.class, in); out = new UDPDestinationOutputStream(out); m.put(OutputStream.class, out); queue.execute(() -> getMessageObserver().onMessage(m)); }
protected void processStreamIo(IoSession session, InputStream in, OutputStream out) { final MessageImpl m = new MessageImpl(); final Exchange exchange = new ExchangeImpl(); exchange.setDestination(UDPDestination.this); m.setDestination(UDPDestination.this); exchange.setInMessage(m); m.setContent(InputStream.class, in); out = new UDPDestinationOutputStream(out); m.put(OutputStream.class, out); queue.execute(() -> getMessageObserver().onMessage(m)); }
/** * Gets the conduit responsible for a transport-level * communication with the remote service. * @return the conduit */ public Conduit getConduit() { Message message = new MessageImpl(); Exchange exchange = new ExchangeImpl(); message.setExchange(exchange); exchange.put(MessageObserver.class, new ClientMessageObserver(this)); if (conduitSelector != null) { exchange.put(Endpoint.class, conduitSelector.getEndpoint()); } exchange.put(Bus.class, bus); prepareConduitSelector(message); return getConduitSelector().selectConduit(message); }
protected Exchange createExchange(Message m, Exchange exchange) { if (exchange == null) { exchange = new ExchangeImpl(); } exchange.setSynchronous(true); exchange.setOutMessage(m); exchange.put(Bus.class, cfg.getBus()); exchange.put(MessageObserver.class, new ClientMessageObserver(cfg)); exchange.put(Endpoint.class, cfg.getConduitSelector().getEndpoint()); exchange.put("org.apache.cxf.transport.no_io_exceptions", true); //REVISIT - when response handling is actually put onto the in chain, this will likely not be needed exchange.put(StaxInEndingInterceptor.STAX_IN_NOCLOSE, Boolean.TRUE); m.setExchange(exchange); return exchange; }
protected Exchange createExchange(Message m, Exchange exchange) { if (exchange == null) { exchange = new ExchangeImpl(); } exchange.setSynchronous(true); exchange.setOutMessage(m); exchange.put(Bus.class, cfg.getBus()); exchange.put(MessageObserver.class, new ClientMessageObserver(cfg)); exchange.put(Endpoint.class, cfg.getConduitSelector().getEndpoint()); exchange.put("org.apache.cxf.transport.no_io_exceptions", true); //REVISIT - when response handling is actually put onto the in chain, this will likely not be needed exchange.put(StaxInEndingInterceptor.STAX_IN_NOCLOSE, Boolean.TRUE); m.setExchange(exchange); return exchange; }
@Test @Description("Enrich a response that contains attachments") public void enrich() throws Exception { ExchangeImpl exchange = new ExchangeImpl(); Document doc = stringToDocument(getResponse()); Map<String, OperationModel> ops = model.getService("TestService").getPort("TestPort").getOperationsMap(); AttachmentResponseEnricher enricher = getEnricher(model.getLoader().getValue(), ops); String result = enricher.enrich(doc, DOWNLOAD_ATTACHMENT, exchange); assertSimilarXml(testValues.getDownloadAttachmentResponse(), result); assertAttachment(exchange); }