Refine search
public void run() { outMessage.getExchange().put(Executor.class.getName() + ".USING_SPECIFIED", Boolean.TRUE); ex2.execute(origRunnable); } };
protected int doProcessResponseCode() throws IOException { Exchange exchange = outMessage.getExchange(); int rc = getResponseCode(); if (rc == -1) { LOG.warning("HTTP Response code appears to be corrupted"); } if (exchange != null) { exchange.put(Message.RESPONSE_CODE, rc); if (rc == 404 || rc == 503) { exchange.put("org.apache.cxf.transport.service_not_available", true); } } // "org.apache.cxf.transport.no_io_exceptions" property should be set in case the exceptions // should not be handled here; for example jax rs uses this // "org.apache.cxf.transport.process_fault_on_http_400" property should be set in case a // soap fault because of a HTTP 400 should be returned back to the client (SOAP 1.2 spec) if (rc >= 400 && rc != 500 && !MessageUtils.getContextualBoolean(outMessage, NO_IO_EXCEPTIONS) && (rc > 400 || !MessageUtils.getContextualBoolean(outMessage, PROCESS_FAULT_ON_HTTP_400))) { throw new HTTPException(rc, getResponseMessage(), url.toURL()); } return rc; }
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); } }
/** * This function processes any retransmits at the direction of redirections * or "unauthorized" responses. * * @return true if there was a retransmit * @throws IOException */ protected boolean processRetransmit() throws IOException { int responseCode = getResponseCode(); if ((outMessage != null) && (outMessage.getExchange() != null)) { outMessage.getExchange().put(Message.RESPONSE_CODE, responseCode); } // Process Redirects first. switch(responseCode) { case HttpURLConnection.HTTP_MOVED_PERM: case HttpURLConnection.HTTP_MOVED_TEMP: case HttpURLConnection.HTTP_SEE_OTHER: case 307: return redirectRetransmit(); case HttpURLConnection.HTTP_UNAUTHORIZED: case HttpURLConnection.HTTP_PROXY_AUTH: return authorizationRetransmit(); default: break; } return false; } protected boolean redirectRetransmit() throws IOException {
outMessage.getExchange().put("client.redirect.exception", "true"); throw ex;
if (!exceptionSet) { try { Executor ex = outMessage.getExchange().get(Executor.class); if (forceWQ && ex != null) { final Executor ex2 = ex; WorkQueueManager mgr = outMessage.getExchange().getBus() .getExtension(WorkQueueManager.class); AutomaticWorkQueue qu = mgr.getNamedWorkQueue("http-conduit"); outMessage.getExchange().put(Executor.class.getName() + ".USING_SPECIFIED", Boolean.TRUE); ex.execute(runnable);
public void handleMessage(Message message) throws Fault { Exchange ex = message.getExchange(); BindingOperationInfo boi = ex.getBindingOperationInfo(); if (Boolean.TRUE.equals(message.get(Message.PARTIAL_RESPONSE_MESSAGE)) ex.put(BindingOperationInfo.class, boi2); Service service = ServiceModelUtil.getService(message.getExchange()); DataBinding dataBinding = service.getDataBinding(); if (dataBinding instanceof WrapperCapableDatabinding) {
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; }
/** * Store indication that a deferred uncorrelated message abort is * supported * * @param message the current message */ public static void storeDeferUncorrelatedMessageAbort(Message message) { if (message.getExchange() != null) { message.getExchange().put("defer.uncorrelated.message.abort", Boolean.TRUE); } }
/** * Store indication that a deferred uncorrelated message abort should * occur * * @param message the current message */ public static void storeDeferredUncorrelatedMessageAbort(Message message) { if (message.getExchange() != null) { message.getExchange().put("deferred.uncorrelated.message.abort", Boolean.TRUE); } }
/** * Store indication that a deferred uncorrelated message abort is * supported * * @param message the current message */ public static void storeDeferUncorrelatedMessageAbort(Message message) { if (message.getExchange() != null) { message.getExchange().put("defer.uncorrelated.message.abort", Boolean.TRUE); } }
/** * Store indication that a deferred uncorrelated message abort should * occur * * @param message the current message */ public static void storeDeferredUncorrelatedMessageAbort(Message message) { if (message.getExchange() != null) { message.getExchange().put("deferred.uncorrelated.message.abort", Boolean.TRUE); } }
/** * Store indication that a deferred uncorrelated message abort should * occur * * @param message the current message */ public static void storeDeferredUncorrelatedMessageAbort(Message message) { if (message.getExchange() != null) { message.getExchange().put("deferred.uncorrelated.message.abort", Boolean.TRUE); } }
public void run() { outMessage.getExchange().put(Executor.class.getName() + ".USING_SPECIFIED", Boolean.TRUE); ex2.execute(origRunnable); } };
private Response createPreflightResponse(Message m, boolean passed) { m.getExchange().put(CrossOriginResourceSharingFilter.class.getName(), passed ? PREFLIGHT_PASSED : PREFLIGHT_FAILED); int status = passed ? 200 : preflightFailStatus; return Response.status(status).build(); }
inMessage.getExchange().put(Bus.class, bus); inMessage.put(Message.DECOUPLED_CHANNEL_MESSAGE, Boolean.TRUE);
public void setProperty(String name, Object value) { if (props == null) { props = new HashMap<>(); m.getExchange().put(PROPERTY_KEY, props); } if (value == null) { removeProperty(name); } else { props.put(name, value); } }
private List<SecurityEvent> getSecurityEventList(Message message) { @SuppressWarnings("unchecked") List<SecurityEvent> securityEvents = (List<SecurityEvent>) message.getExchange().get(SecurityEvent.class.getName() + ".out"); if (securityEvents == null) { securityEvents = new ArrayList<>(); message.getExchange().put(SecurityEvent.class.getName() + ".out", securityEvents); } return securityEvents; }
public void createExchangeId(Message message) { Exchange exchange = message.getExchange(); String exchangeId = (String)exchange.get(LogEvent.KEY_EXCHANGE_ID); if (exchangeId == null) { exchangeId = UUID.randomUUID().toString(); exchange.put(LogEvent.KEY_EXCHANGE_ID, exchangeId); } }
@Override protected void handleValidation(Message message, Object resourceInstance, Method method, List<Object> arguments) { message.getExchange().put("wrap.in.processing.exception", wrapInProcessingException); super.handleValidation(message, resourceInstance, method, arguments); }