@Override public Void run() { InterceptorChain chain = message.getInterceptorChain(); if (chain != null) { chain.doIntercept(message); } return null; } });
@Override public Void run() { InterceptorChain chain = message.getInterceptorChain(); if (chain != null) { chain.doIntercept(message); } return null; } });
private void handleAbort(Message message, W3CDOMStreamWriter writer) { message.getInterceptorChain().abort(); if (!message.getExchange().isOneWay()) { //server side inbound Endpoint e = message.getExchange().getEndpoint(); Message responseMsg = new MessageImpl(); responseMsg.setExchange(message.getExchange()); responseMsg = e.getBinding().createMessage(responseMsg); message.getExchange().setOutMessage(responseMsg); XMLStreamReader reader = message.getContent(XMLStreamReader.class); if (reader == null && writer != null) { reader = StaxUtils.createXMLStreamReader(writer.getDocument()); } InterceptorChain chain = OutgoingChainInterceptor .getOutInterceptorChain(message.getExchange()); responseMsg.setInterceptorChain(chain); responseMsg.put("LogicalHandlerInterceptor.INREADER", reader); chain.doIntercept(responseMsg); } }
@Override public Void run() { InterceptorChain chain = message.getInterceptorChain(); if (chain != null) { message.put("suspend.chain.on.current.interceptor", Boolean.TRUE); chain.doIntercept(message); } return null; } });
protected void doRunInterceptorChain(Message m) { try { m.getInterceptorChain().doIntercept(m); } catch (Exception ex) { m.setContent(Exception.class, ex); } }
@Override public Void run() { InterceptorChain chain = message.getInterceptorChain(); if (chain != null) { message.put("suspend.chain.on.current.interceptor", Boolean.TRUE); chain.doIntercept(message); } return null; } });
protected void doRunInterceptorChain(Message m) { try { m.getInterceptorChain().doIntercept(m); } catch (Exception ex) { m.setContent(Exception.class, ex); } }
public void write(MuleEvent event, OutputStream out) throws IOException { synchronized (delegating.getOutputStream()) { out.write(cache.toByteArray()); delegating.setOutputStream(out); } // resume writing! message.getInterceptorChain().doIntercept(message); } };
protected void doRunInterceptorChain(Message m) { try { m.getInterceptorChain().doIntercept(m); } catch (Exception ex) { m.setContent(Exception.class, ex); } }
ic.doIntercept(faultMessage);
chain.doIntercept(message); Exception ex = message.getContent(Exception.class); if (null != ex) {
public void handleMessage(Message msg) throws Fault { Exchange ex = msg.getExchange(); if (ex.isOneWay()) { return; } Bus bus = ex.getBus(); SortedSet<Phase> phases = new TreeSet<>(bus.getExtension(PhaseManager.class).getOutPhases()); //TODO Set Coloc FaultObserver chain ColocUtil.setPhases(phases, Phase.SETUP, Phase.USER_LOGICAL); InterceptorChain chain = ColocUtil.getOutInterceptorChain(ex, phases); if (LOG.isLoggable(Level.FINER)) { LOG.finer("Processing Message at collocated endpoint. Response message: " + msg); } //Initiate OutBound Processing BindingOperationInfo boi = ex.getBindingOperationInfo(); Message outBound = ex.getOutMessage(); if (boi != null) { outBound.put(MessageInfo.class, boi.getOperationInfo().getOutput()); } outBound.put(Message.INBOUND_MESSAGE, Boolean.FALSE); outBound.setInterceptorChain(chain); chain.doIntercept(outBound); } }
public void handleMessage(Message msg) throws Fault { Exchange ex = msg.getExchange(); if (ex.isOneWay()) { return; } Bus bus = ex.getBus(); SortedSet<Phase> phases = new TreeSet<>(bus.getExtension(PhaseManager.class).getOutPhases()); //TODO Set Coloc FaultObserver chain ColocUtil.setPhases(phases, Phase.SETUP, Phase.USER_LOGICAL); InterceptorChain chain = ColocUtil.getOutInterceptorChain(ex, phases); if (LOG.isLoggable(Level.FINER)) { LOG.finer("Processing Message at collocated endpoint. Response message: " + msg); } //Initiate OutBound Processing BindingOperationInfo boi = ex.getBindingOperationInfo(); Message outBound = ex.getOutMessage(); if (boi != null) { outBound.put(MessageInfo.class, boi.getOperationInfo().getOutput()); } outBound.put(Message.INBOUND_MESSAGE, Boolean.FALSE); outBound.setInterceptorChain(chain); chain.doIntercept(outBound); } }
/** * {@inheritDoc} * <p> * Intercepts the SOAP message and performs the dispatch of it, receiving the response and * sending it to the IN intercepting processor chain. */ @Override public void handleMessage(Message message) throws Fault { Exchange exchange = message.getExchange(); Object encoding = exchange.get(ENCODING); message.put(ENCODING, encoding); // Performs all the remaining interceptions before sending. message.getInterceptorChain().doIntercept(message); // Wipe the request attachment list, so don't get mixed with the response ones. message.setAttachments(emptyList()); MessageDispatcher dispatcher = (MessageDispatcher) exchange.get(MESSAGE_DISPATCHER); DispatchingResponse response = dispatcher.dispatch(getDispatchingRequest(message)); // This needs to be set because we want the wsc closes the final stream, // otherwise cxf will close it too early when handling message in the StaxInEndingInterceptor. exchange.put(STAX_IN_NOCLOSE, TRUE); if (OperationType.ONE_WAY.equals(exchange.get(MULE_SOAP_OPERATION_STYLE))) { exchange.put(ClientImpl.FINISHED, true); } else { handleRequestResponse(exchange, encoding, response); } }
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); }
private void handleAbort(Message message, W3CDOMStreamWriter writer) { message.getInterceptorChain().abort(); if (!message.getExchange().isOneWay()) { //server side inbound Endpoint e = message.getExchange().getEndpoint(); Message responseMsg = new MessageImpl(); responseMsg.setExchange(message.getExchange()); responseMsg = e.getBinding().createMessage(responseMsg); message.getExchange().setOutMessage(responseMsg); XMLStreamReader reader = message.getContent(XMLStreamReader.class); if (reader == null && writer != null) { reader = StaxUtils.createXMLStreamReader(writer.getDocument()); } InterceptorChain chain = OutgoingChainInterceptor .getOutInterceptorChain(message.getExchange()); responseMsg.setInterceptorChain(chain); responseMsg.put("LogicalHandlerInterceptor.INREADER", reader); chain.doIntercept(responseMsg); } }
public void handleMessage(Message message) { Exchange ex = message.getExchange(); BindingOperationInfo binding = ex.get(BindingOperationInfo.class); //if we get this far, we're going to be outputting some valid content, but we COULD //also be "echoing" some of the content from the input. Thus, we need to //mark it as requiring the input to be cached. if (message.getExchange().get(CACHE_INPUT_PROPERTY) == null) { message.put(CACHE_INPUT_PROPERTY, Boolean.TRUE); } if (null != binding && null != binding.getOperationInfo() && binding.getOperationInfo().isOneWay()) { closeInput(message); return; } Message out = ex.getOutMessage(); if (out != null) { getBackChannelConduit(message); if (binding != null) { out.put(MessageInfo.class, binding.getOperationInfo().getOutput()); out.put(BindingMessageInfo.class, binding.getOutput()); } InterceptorChain outChain = out.getInterceptorChain(); if (outChain == null) { outChain = OutgoingChainInterceptor.getChain(ex, chainCache); out.setInterceptorChain(outChain); } outChain.doIntercept(out); } }
public void handleMessage(Message message) { Exchange ex = message.getExchange(); BindingOperationInfo binding = ex.get(BindingOperationInfo.class); //if we get this far, we're going to be outputting some valid content, but we COULD //also be "echoing" some of the content from the input. Thus, we need to //mark it as requiring the input to be cached. if (message.getExchange().get(CACHE_INPUT_PROPERTY) == null) { message.put(CACHE_INPUT_PROPERTY, Boolean.TRUE); } if (null != binding && null != binding.getOperationInfo() && binding.getOperationInfo().isOneWay()) { closeInput(message); return; } Message out = ex.getOutMessage(); if (out != null) { getBackChannelConduit(message); if (binding != null) { out.put(MessageInfo.class, binding.getOperationInfo().getOutput()); out.put(BindingMessageInfo.class, binding.getOutput()); } InterceptorChain outChain = out.getInterceptorChain(); if (outChain == null) { outChain = OutgoingChainInterceptor.getChain(ex, chainCache); out.setInterceptorChain(outChain); } outChain.doIntercept(out); } }
return; outChain.doIntercept(out);