Refine search
inMessage.setExchange(new ExchangeImpl()); inMessage.getExchange().put(Bus.class, bus); inMessage.put(Message.DECOUPLED_CHANNEL_MESSAGE, Boolean.TRUE);
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 } } } } };
LOG.fine("Service http request on thread: " + Thread.currentThread()); Message inMessage = new MessageImpl(); ExchangeImpl exchange = new ExchangeImpl(); exchange.setInMessage(inMessage); ((MessageImpl)inMessage).setDestination(this); exchange.setSession(new HTTPSession(req));
public void setConduit(Conduit c) { put(ConduitSelector.class, new PreexistingConduitSelector(c, getEndpoint())); }
private MultipartBody createAttachments(String propertyName) { Message inMessage = m.getExchange().getInMessage(); boolean embeddedAttachment = inMessage.get("org.apache.cxf.multipart.embedded") != null; Object o = inMessage.get(propertyName); if (o != null) { return (MultipartBody)o; inMessage = new MessageImpl(); inMessage.setExchange(new ExchangeImpl()); inMessage.put(AttachmentDeserializer.ATTACHMENT_DIRECTORY, m.getExchange().getInMessage().get(AttachmentDeserializer.ATTACHMENT_DIRECTORY)); inMessage.put(AttachmentDeserializer.ATTACHMENT_MEMORY_THRESHOLD, m.getExchange().getInMessage().get(AttachmentDeserializer.ATTACHMENT_MEMORY_THRESHOLD)); inMessage.put(AttachmentDeserializer.ATTACHMENT_MAX_SIZE, m.getExchange().getInMessage().get(AttachmentDeserializer.ATTACHMENT_MAX_SIZE));
info.setAddress(base.toString()); final Conduit c = ci.getConduit(info, bus); Message message = new MessageImpl(); Exchange exch = new ExchangeImpl(); message.setExchange(exch); message.put(Message.HTTP_REQUEST_METHOD, "GET"); c.setMessageObserver(new MessageObserver() { public void onMessage(Message message) { c.prepare(message); c.close(message); InputStream ins = exch.get(InputStream.class); resourceOpened.addElement(ins); InputSource src = new InputSource(ins); String u = (String)message.get("transport.retransmit.url"); if (u == null) { u = base.toString();
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); } }
if (newDestinationURI != null) { ei.setAddress((String) newDestinationURI); message.put(Message.ENDPOINT_ADDRESS, newDestinationURI); message.put(MessageExchange.class, exchange); Exchange cxfExchange = new ExchangeImpl(); cxfExchange.setConduit(conduit); cxfExchange.setSynchronous(isSynchronous()); cxfExchange.put(MessageExchange.class, exchange); message.setExchange(cxfExchange); cxfExchange.setOutMessage(message); cxfExchange.put(CxfBcProvider.class, this);
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); }
Message m = null; if (pf.isParamConverterContextsAvailable()) { m = new MessageImpl(); m.put(Message.REQUESTOR_ROLE, Boolean.TRUE); m.setExchange(new ExchangeImpl()); m.getExchange().setOutMessage(m); m.getExchange().put(Endpoint.class, cfg.getEndpoint());
LOG.finer("Processing Message at collocated endpoint. Request message: " + m); Exchange ex = new ExchangeImpl(); setExchangeProperties(ex, m); MessageImpl.copyContent(m, inMsg); inMsg.putAll(m); inMsg.put(COLOCATED, Boolean.TRUE); inMsg.put(Message.REQUESTOR_ROLE, Boolean.FALSE); inMsg.put(Message.INBOUND_MESSAGE, Boolean.TRUE); BindingOperationInfo boi = ex.getBindingOperationInfo(); OperationInfo oi = boi != null ? boi.getOperationInfo() : null; if (oi != null) { inMsg.put(MessageInfo.class, oi.getInput()); ex.setInMessage(inMsg); inMsg.setExchange(ex); BindingOperationInfo bop = m.getExchange().getBindingOperationInfo(); OperationInfo soi = bop != null ? bop.getOperationInfo() : null; if (soi != null && oi != null) {
origLoader = ClassLoaderUtils.setThreadContextClassloader(loader); Exchange exchange = message.getExchange(); if (exchange == null) { exchange = new ExchangeImpl(); exchange.setInMessage(message); message.setExchange(exchange); message.setExchange(exchange); exchange.setInMessage(message); setExchangeProperties(exchange, message); exchange.put(ENDPOINTS, endpoints);
exchange = new ExchangeImpl(); exchange.setSynchronous(callback == null); Endpoint endpoint = getEndpoint(); if (LOG.isLoggable(Level.FINE)) { message.put(Message.INVOCATION_CONTEXT, context); setContext(reqContext, message); exchange.putAll(reqContext); exchange.setOneWay(oi.getOutput() == null); message.setInterceptorChain(chain); if (callback == null) { chain.setFaultObserver(outFaultObserver);
private void setTerminateSequence(Message msg, Identifier identifier, ProtocolVariation protocol) throws RMException { TerminateSequenceType ts = new TerminateSequenceType(); ts.setIdentifier(identifier); MessageContentsList contents = new MessageContentsList(new Object[]{protocol.getCodec().convertToSend(ts)}); msg.setContent(List.class, contents); // create a new exchange for this output-only exchange Exchange newex = new ExchangeImpl(); Exchange oldex = msg.getExchange(); newex.put(Bus.class, oldex.getBus()); newex.put(Endpoint.class, oldex.getEndpoint()); newex.put(Service.class, oldex.getEndpoint().getService()); newex.put(Binding.class, oldex.getEndpoint().getBinding()); newex.setConduit(oldex.getConduit(msg)); newex.setDestination(oldex.getDestination()); //Setup the BindingOperationInfo RMEndpoint rmep = getManager().getReliableEndpoint(msg); OperationInfo oi = rmep.getEndpoint(protocol).getEndpointInfo().getService().getInterface() .getOperation(protocol.getConstants().getTerminateSequenceAnonymousOperationName()); BindingInfo bi = rmep.getBindingInfo(protocol); BindingOperationInfo boi = bi.getOperation(oi); newex.put(BindingInfo.class, bi); newex.put(BindingOperationInfo.class, boi); msg.setExchange(newex); newex.setOutMessage(msg); }
if (m.getInterceptorChain() != null) { phaseChain = m.getInterceptorChain(); Exchange exchange = message.getExchange(); if (exchange == null) { exchange = new ExchangeImpl(); m.setExchange(exchange); exchange.setInMessage(message); setExchangeProperties(exchange, message);
conduit.setMessageObserver(obs); Message m = new MessageImpl(); String ct = "multipart/related; type=\"application/xop+xml\"; " + "start=\"<soap.xml@xfire.codehaus.org>\"; " + "boundary=\"----=_Part_4_701508.1145579811786\""; m.put(Message.CONTENT_TYPE, ct); conduit.prepare(m); OutputStream os = m.getContent(OutputStream.class); InputStream is = testUtilities.getResourceAsStream("request"); if (is == null) { MessageImpl resMsg = new MessageImpl(); resMsg.setContent(InputStream.class, new ByteArrayInputStream(res)); resMsg.put(Message.CONTENT_TYPE, obs.getResponseContentType()); resMsg.setExchange(new ExchangeImpl()); AttachmentDeserializer deserializer = new AttachmentDeserializer(resMsg); deserializer.initializeAttachments();
protected void processInMessage(org.apache.cxf.message.Message inMessage) { Destination destination = inMessage.getDestination(); ReliableJMSTransportDestination reliableJMSTransportDestination = null; ReliableJMSTransportConfiguration reliableJMSTransportConfiguration = null; inMessage.put(org.apache.cxf.message.Message.INBOUND_MESSAGE, true); inMessage.put(org.apache.cxf.message.Message.REQUESTOR_ROLE, true); SoapMessage outMessage = new SoapMessage(new MessageImpl()); Exchange exchange = new ExchangeImpl(); exchange.setInMessage(inMessage); exchange.setOutMessage(outMessage); inMessage.setExchange(exchange); outMessage.setExchange(exchange); exchange.put(ReliableJMSTransportConfiguration.class, reliableJMSTransportConfiguration); break; default:
stream = new ByteArrayInputStream(requestBody.getBytes(StandardCharsets.UTF_8.name())); final Message message = new MessageImpl(); final Exchange exchange = new ExchangeImpl(); message.setExchange(exchange); message.put(Message.CONTENT_TYPE, contentType); message.setContent(InputStream.class, stream);
acksTo = maps.getReplyTo(); if (RMUtils.getAddressingConstants().getNoneURI().equals(acksTo.getAddress().getValue())) { Endpoint ei = message.getExchange().getEndpoint(); org.apache.cxf.transport.Destination dest = ei == null ? null : ei.getEndpointInfo() Exchange exchange = new ExchangeImpl(); Map<String, Object> context = new HashMap<>(16); for (String key : message.getContextualPropertyKeys()) { context.put(key, message.getContextualProperty(key)); Exchange appex = message.getExchange(); if (appex.get(SecurityConstants.TOKEN) == null) { appex.put(SecurityConstants.TOKEN, exchange.get(SecurityConstants.TOKEN)); appex.put(SecurityConstants.TOKEN_ID, exchange.get(SecurityConstants.TOKEN_ID));