/** * This predicate returns true if the exchange indicates * a oneway MEP. * * @param exchange The exchange in question */ private boolean isOneway(Exchange exchange) { return exchange != null && exchange.isOneWay(); }
/** * @param message the message under consideration * @return true iff the message has been marked as oneway */ protected final boolean isOneWay(Message message) { Exchange ex = message.getExchange(); return ex == null ? false : ex.isOneWay(); }
/** {@inheritDoc}*/ public Continuation getContinuation() { if (inMessage.getExchange().isOneWay()) { return null; } if (continuation == null) { continuation = IS_31 ? new Servlet31Continuation() : new Servlet3Continuation(); } else { continuation.startAsyncAgain(); } return continuation; }
public void cacheInput() { if (!cached && (exchange.isOneWay() || isWSAddressingReplyToSpecified(exchange))) { //For one-ways and WS-Addressing invocations with ReplyTo address, //we need to cache the values of the HttpServletRequest //so they can be queried later for things like paths and schemes //and such like that. //Please note, exchange used to always get the "current" message exchange.getInMessage().put(HTTP_REQUEST, new HttpServletRequestSnapshot(req)); } super.cacheInput(); } private boolean isWSAddressingReplyToSpecified(Exchange ex) {
private Message createResponseMessage(Exchange exchange) { if (exchange == null) { return null; } Message m = exchange.getOutMessage(); if (m == null && !exchange.isOneWay()) { Endpoint ep = exchange.getEndpoint(); m = new MessageImpl(); m.setExchange(exchange); m = ep.getBinding().createMessage(m); exchange.setOutMessage(m); } return m; }
/** * This predicate returns true if the exchange indicates * a oneway MEP. * * @param exchange The exchange in question */ private boolean isOneway(Exchange exchange) { return exchange != null && exchange.isOneWay(); }
protected HandlerChainInvoker getInvoker(T message) { Exchange ex = message.getExchange(); HandlerChainInvoker invoker = ex.get(HandlerChainInvoker.class); if (null == invoker) { invoker = new HandlerChainInvoker(binding.getHandlerChain(), isOutbound(message)); ex.put(HandlerChainInvoker.class, invoker); } boolean outbound = isOutbound(message, ex); if (outbound) { invoker.setOutbound(); } else { invoker.setInbound(); } invoker.setRequestor(isRequestor(message)); if (ex.isOneWay() || ((isRequestor(message) && !outbound) || (!isRequestor(message) && outbound))) { invoker.setResponseExpected(false); } else { invoker.setResponseExpected(true); } return invoker; }
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); } }
if (!message.getExchange().isOneWay()) { Endpoint e = message.getExchange().getEndpoint(); Message responseMsg = new MessageImpl();
private Message createResponseMessage() { if (exchange == null || exchange.isOneWay()) { return null;
protected void setSupportOnewayResponseProperty(Message outMessage) { if (!outMessage.getExchange().isOneWay()) { outMessage.put(Message.PROCESS_ONEWAY_RESPONSE, true); } } private void checkClosed() {
public void handleMessage(Message message) throws Fault { Exchange ex = message.getExchange(); if (ex.isOneWay() && !isRequestor(message)) { stop(message); } } }
public void handleMessage(Message message) throws Fault { Exchange ex = message.getExchange(); if (ex.isOneWay() && !isClient(message)) { setOneWayMessage(ex); } } }
private Integer getResponseCode(Exchange exchange) { Integer responseCode = (Integer)exchange.get(Message.RESPONSE_CODE); if (responseCode == null && exchange.getInMessage() != null) { responseCode = (Integer)exchange.getInMessage().get(Message.RESPONSE_CODE); } if (responseCode == null && exchange.isOneWay() && !state.getBaseURI().toString().startsWith("http")) { responseCode = 202; } return responseCode; }
/** {@inheritDoc}*/ public Continuation getContinuation() { if (inMessage.getExchange().isOneWay()) { return null; } if (continuation == null) { continuation = IS_31 ? new Servlet31Continuation() : new Servlet3Continuation(); } else { continuation.startAsyncAgain(); } return continuation; }
public void handleMessage(Message message) throws Fault { if (!isRequestor(message)) { stop(message); } else if (message.getExchange().isOneWay()) { //one way on the client, it's sent, now stop stop(message); } } }
public void sendExchange(Exchange exchange, final Object replyObj) { if (exchange.isOneWay()) { //Don't need to send anything return; } final Message outMessage = exchange.getOutMessage(); try (ResourceCloser closer = new ResourceCloser()) { send(outMessage, replyObj, closer); } catch (JMSException ex) { throw JMSUtil.convertJmsException(ex); } }
@POST @Path("/oneway") @Oneway public void onewayRequest() { if (!PhaseInterceptorChain.getCurrentMessage().getExchange().isOneWay()) { throw new WebApplicationException(); } }
public void cacheInput() { if (!cached && (exchange.isOneWay() || isWSAddressingReplyToSpecified(exchange))) { //For one-ways and WS-Addressing invocations with ReplyTo address, //we need to cache the values of the HttpServletRequest //so they can be queried later for things like paths and schemes //and such like that. //Please note, exchange used to always get the "current" message exchange.getInMessage().put(HTTP_REQUEST, new HttpServletRequestSnapshot(req)); } super.cacheInput(); } private boolean isWSAddressingReplyToSpecified(Exchange ex) {