public void setInterceptorChain(InterceptorChain chain) { message.setInterceptorChain(chain); }
public void setInterceptorChain(InterceptorChain chain) { message.setInterceptorChain(chain); }
public void setInterceptorChain(InterceptorChain chain) { message.setInterceptorChain(chain); }
public void setInterceptorChain(InterceptorChain chain) { message.setInterceptorChain(chain); }
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); } }
faultMessage.setInterceptorChain(ic); ic.doIntercept(faultMessage);
responseMsg.setInterceptorChain(chain);
message.setInterceptorChain(chain); chain.doIntercept(message); Exception ex = message.getContent(Exception.class);
private Message createOutMessage(Message inMessage, Response r) { Endpoint e = inMessage.getExchange().getEndpoint(); Message mout = e.getBinding().createMessage(); mout.setContent(List.class, new MessageContentsList(r)); mout.setExchange(inMessage.getExchange()); mout.setInterceptorChain( OutgoingChainInterceptor.getOutInterceptorChain(inMessage.getExchange())); inMessage.getExchange().setOutMessage(mout); if (r.getStatus() >= Response.Status.BAD_REQUEST.getStatusCode()) { inMessage.getExchange().put("cxf.io.cacheinput", Boolean.FALSE); } return mout; } }
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); } }
private Message createOutMessage(Message inMessage, Response r) { Endpoint e = inMessage.getExchange().get(Endpoint.class); Message mout = new MessageImpl(); mout.setContent(List.class, new MessageContentsList(r)); mout.setExchange(inMessage.getExchange()); mout = e.getBinding().createMessage(mout); mout.setInterceptorChain( OutgoingChainInterceptor.getOutInterceptorChain(inMessage.getExchange())); inMessage.getExchange().setOutMessage(mout); if (r.getStatus() >= Response.Status.BAD_REQUEST.getStatusCode()) { inMessage.getExchange().put("cxf.io.cacheinput", Boolean.FALSE); } return mout; } }
private Message createOutMessage(Message inMessage) { Endpoint e = inMessage.getExchange().getEndpoint(); Message mout = e.getBinding().createMessage(); mout.setExchange(inMessage.getExchange()); mout.setInterceptorChain( OutgoingChainInterceptor.getOutInterceptorChain(inMessage.getExchange())); inMessage.getExchange().setOutMessage(mout); inMessage.getExchange().put("cxf.io.cacheinput", Boolean.FALSE); return mout; } }
private Message createOutMessage(Message inMessage) { Endpoint e = inMessage.getExchange().getEndpoint(); Message mout = e.getBinding().createMessage(); mout.setExchange(inMessage.getExchange()); mout.setInterceptorChain( OutgoingChainInterceptor.getOutInterceptorChain(inMessage.getExchange())); inMessage.getExchange().setOutMessage(mout); inMessage.getExchange().put("cxf.io.cacheinput", Boolean.FALSE); return mout; } }
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(); } } }
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); } }