exchange.setInMessage(inMessage); return;
.getContent(XMLStreamReader.class)); message.getExchange().setInMessage(responseMsg); responseMsg.put(InterceptorChain.STARTING_AT_INTERCEPTOR_ID, LogicalHandlerInInterceptor.class.getName());
public void run() { if (exchange != null) { exchange.setInMessage(m); } conduit.getMessageObserver().onMessage(m); } };
m.setExchange(exchange); m = ep.getBinding().createMessage(m); exchange.setInMessage(m);
public void run() { if (exchange != null) { exchange.setInMessage(m); } conduit.getMessageObserver().onMessage(m); } };
message.getExchange().setInMessage(responseMsg); SOAPMessage soapMessage = ((SOAPMessageContext)context).getMessage();
protected void setOutBoundMessage(Exchange from, Exchange to) { if (from.getOutFaultMessage() != null) { to.setInFaultMessage(from.getOutFaultMessage()); } else { to.setInMessage(from.getOutMessage()); } }
protected void setOutBoundMessage(Exchange from, Exchange to) { if (from.getOutFaultMessage() != null) { to.setInFaultMessage(from.getOutFaultMessage()); } else { to.setInMessage(from.getOutMessage()); } }
message.getExchange().setInMessage(message); message.setInterceptorChain(chain); chain.doIntercept(message);
/** * Process the reply message * @throws JMSException */ protected void processReplyMessage(Exchange exchange, javax.jms.Message jmsMessage) throws JMSException { LOG.log(Level.FINE, "client received reply: ", jmsMessage); try { Message inMessage = JMSMessageUtils.asCXFMessage(jmsMessage, JMSConstants.JMS_CLIENT_RESPONSE_HEADERS); if (jmsConfig.isCreateSecurityContext()) { SecurityContext securityContext = SecurityContextFactory.buildSecurityContext(jmsMessage, jmsConfig); inMessage.put(SecurityContext.class, securityContext); } exchange.setInMessage(inMessage); Object responseCode = inMessage.get(org.apache.cxf.message.Message.RESPONSE_CODE); exchange.put(org.apache.cxf.message.Message.RESPONSE_CODE, responseCode); if (exchange.isSynchronous()) { synchronized (exchange) { exchange.put(CORRELATED, Boolean.TRUE); exchange.notifyAll(); } } if (incomingObserver != null) { incomingObserver.onMessage(exchange.getInMessage()); } } catch (UnsupportedEncodingException ex) { getLogger().log(Level.WARNING, "can't get the right encoding information " + ex); } }
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)); }
protected NVList prepareArguments(CorbaMessage corbaMsg, InterfaceInfo info, OperationType opType, QName opQName, CorbaTypeMap typeMap, CorbaDestination destination, ServiceInfo service) { BindingInfo bInfo = destination.getBindingInfo(); EndpointInfo eptInfo = destination.getEndPointInfo(); BindingOperationInfo bOpInfo = bInfo.getOperation(opQName); OperationInfo opInfo = bOpInfo.getOperationInfo(); Exchange exg = corbaMsg.getExchange(); exg.put(BindingInfo.class, bInfo); exg.put(InterfaceInfo.class, info); exg.put(EndpointInfo.class, eptInfo); exg.put(EndpointReferenceType.class, destination.getAddress()); exg.put(ServiceInfo.class, service); exg.put(BindingOperationInfo.class, bOpInfo); exg.put(OperationInfo.class, opInfo); exg.put(MessageInfo.class, opInfo.getInput()); exg.put(String.class, opQName.getLocalPart()); exg.setInMessage(corbaMsg); corbaMsg.put(MessageInfo.class, opInfo.getInput()); List<ParamType> paramTypes = opType.getParam(); CorbaStreamable[] arguments = new CorbaStreamable[paramTypes.size()]; return prepareDIIArgsList(corbaMsg, bOpInfo, arguments, paramTypes, typeMap, exg.get(ORB.class), service); }
public void onMessage(Message m) { Message message = cfg.getConduitSelector().getEndpoint().getBinding().createMessage(m); message.put(Message.REQUESTOR_ROLE, Boolean.TRUE); message.put(Message.INBOUND_MESSAGE, Boolean.TRUE); PhaseInterceptorChain chain = AbstractClient.setupInInterceptorChain(cfg); message.setInterceptorChain(chain); message.getExchange().setInMessage(message); Bus bus = cfg.getBus(); Bus origBus = BusFactory.getAndSetThreadDefaultBus(bus); ClassLoaderHolder origLoader = null; try { if (loader != null) { origLoader = ClassLoaderUtils.setThreadContextClassloader(loader); } // execute chain chain.doIntercept(message); } finally { if (origBus != bus) { BusFactory.setThreadDefaultBus(origBus); } if (origLoader != null) { origLoader.reset(); } synchronized (message.getExchange()) { message.getExchange().notifyAll(); } } }
public void onMessage(Message m) { Message message = cfg.getConduitSelector().getEndpoint().getBinding().createMessage(m); message.put(Message.REQUESTOR_ROLE, Boolean.TRUE); message.put(Message.INBOUND_MESSAGE, Boolean.TRUE); PhaseInterceptorChain chain = AbstractClient.setupInInterceptorChain(cfg); message.setInterceptorChain(chain); message.getExchange().setInMessage(message); Bus bus = cfg.getBus(); Bus origBus = BusFactory.getAndSetThreadDefaultBus(bus); ClassLoaderHolder origLoader = null; try { if (loader != null) { origLoader = ClassLoaderUtils.setThreadContextClassloader(loader); } // execute chain chain.doIntercept(message); } finally { if (origBus != bus) { BusFactory.setThreadDefaultBus(origBus); } if (origLoader != null) { origLoader.reset(); } synchronized (message.getExchange()) { message.getExchange().notifyAll(); } } }
@Override public void close(Message message) throws IOException { // set the pseudo status code if not set (REVISIT add this method in MessageUtils to be reused elsewhere?) Integer i = (Integer)message.get(Message.RESPONSE_CODE); if (i == null) { int code = ((message.getExchange().isOneWay() && !MessageUtils.isPartialResponse(message)) || MessageUtils.isEmptyPartialResponse(message)) ? 202 : 200; message.put(Message.RESPONSE_CODE, code); } 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); message.getContent(OutputStream.class).close(); CachedOutputStream stream = message.getContent(CachedOutputStream.class); message.setContent(OutputStream.class, stream); MessageImpl.copyContent(message, copy); copy.setContent(InputStream.class, stream.getInputStream()); stream.releaseTempFileHold(); if (exchange != null && exchange.getInMessage() == null) { exchange.setInMessage(copy); } conduit.getMessageObserver().onMessage(copy); return; } super.close(message); }
public void onMessage(Message m) { Message message = cfg.getConduitSelector().getEndpoint().getBinding().createMessage(m); message.put(Message.REQUESTOR_ROLE, Boolean.TRUE); message.put(Message.INBOUND_MESSAGE, Boolean.TRUE); PhaseInterceptorChain chain = AbstractClient.setupInInterceptorChain(cfg); message.setInterceptorChain(chain); message.getExchange().setInMessage(message); Bus bus = cfg.getBus(); Bus origBus = BusFactory.getAndSetThreadDefaultBus(bus); ClassLoaderHolder origLoader = null; try { if (loader != null) { origLoader = ClassLoaderUtils.setThreadContextClassloader(loader); } // execute chain chain.doIntercept(message); } finally { if (origBus != bus) { BusFactory.setThreadDefaultBus(origBus); } if (origLoader != null) { origLoader.reset(); } synchronized (message.getExchange()) { message.getExchange().notifyAll(); } } }
@Override public void close(Message message) throws IOException { // set the pseudo status code if not set (REVISIT add this method in MessageUtils to be reused elsewhere?) Integer i = (Integer)message.get(Message.RESPONSE_CODE); if (i == null) { int code = ((message.getExchange().isOneWay() && !MessageUtils.isPartialResponse(message)) || MessageUtils.isEmptyPartialResponse(message)) ? 202 : 200; message.put(Message.RESPONSE_CODE, code); } 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); message.getContent(OutputStream.class).close(); CachedOutputStream stream = message.getContent(CachedOutputStream.class); message.setContent(OutputStream.class, stream); MessageImpl.copyContent(message, copy); copy.setContent(InputStream.class, stream.getInputStream()); stream.releaseTempFileHold(); if (exchange != null && exchange.getInMessage() == null) { exchange.setInMessage(copy); } conduit.getMessageObserver().onMessage(copy); return; } super.close(message); }
protected void invokeInboundChain(Exchange ex, Endpoint ep) { Message m = getInBoundMessage(ex); Message inMsg = ep.getBinding().createMessage(); MessageImpl.copyContent(m, inMsg); //Copy Response Context to Client inBound Message //TODO a Context Filter Strategy required. inMsg.putAll(m); inMsg.put(Message.REQUESTOR_ROLE, Boolean.TRUE); inMsg.put(Message.INBOUND_MESSAGE, Boolean.TRUE); inMsg.setExchange(ex); Exception exc = inMsg.getContent(Exception.class); if (exc != null) { ex.setInFaultMessage(inMsg); ColocInFaultObserver observer = new ColocInFaultObserver(bus); observer.onMessage(inMsg); } else { //Handle Response ex.setInMessage(inMsg); PhaseManager pm = bus.getExtension(PhaseManager.class); SortedSet<Phase> phases = new TreeSet<>(pm.getInPhases()); ColocUtil.setPhases(phases, Phase.USER_LOGICAL, Phase.PRE_INVOKE); InterceptorChain chain = ColocUtil.getInInterceptorChain(ex, phases); inMsg.setInterceptorChain(chain); chain.doIntercept(inMsg); } ex.put(ClientImpl.FINISHED, Boolean.TRUE); }
protected void invokeInboundChain(Exchange ex, Endpoint ep) { Message m = getInBoundMessage(ex); Message inMsg = ep.getBinding().createMessage(); MessageImpl.copyContent(m, inMsg); //Copy Response Context to Client inBound Message //TODO a Context Filter Strategy required. inMsg.putAll(m); inMsg.put(Message.REQUESTOR_ROLE, Boolean.TRUE); inMsg.put(Message.INBOUND_MESSAGE, Boolean.TRUE); inMsg.setExchange(ex); Exception exc = inMsg.getContent(Exception.class); if (exc != null) { ex.setInFaultMessage(inMsg); ColocInFaultObserver observer = new ColocInFaultObserver(bus); observer.onMessage(inMsg); } else { //Handle Response ex.setInMessage(inMsg); PhaseManager pm = bus.getExtension(PhaseManager.class); SortedSet<Phase> phases = new TreeSet<>(pm.getInPhases()); ColocUtil.setPhases(phases, Phase.USER_LOGICAL, Phase.PRE_INVOKE); InterceptorChain chain = ColocUtil.getInInterceptorChain(ex, phases); inMsg.setInterceptorChain(chain); chain.doIntercept(inMsg); } ex.put(ClientImpl.FINISHED, Boolean.TRUE); }