getProperty("org.apache.cxf.ws.addressing.MAPAggregator.decoupledDestination")) { ClientCallback cc = exchange.remove(ClientCallback.class); if (null != cc) { cc.handleResponse(null, null);
@Override public void handleMessage(final Message msg) throws Fault { final Long startTime = (Long) msg.getExchange().remove(TimingSendInterceptor.KEY); if (startTime != null) { final long executionTime = System.currentTimeMillis() - startTime; logger.info(formatLogEntry(msg, executionTime)); } }
protected void setupExchangeExceptionProperties(Exchange ex) { if (!isSupportNotAvailableErrorsOnly()) { ex.remove("org.apache.cxf.transport.no_io_exceptions"); } ex.put(COMPLETE_IF_SERVICE_NOT_AVAIL_PROPERTY, true); }
protected void setupExchangeExceptionProperties(Exchange ex) { if (!isSupportNotAvailableErrorsOnly()) { ex.remove("org.apache.cxf.transport.no_io_exceptions"); } ex.put(COMPLETE_IF_SERVICE_NOT_AVAIL_PROPERTY, true); }
public static void releaseRequestState(ServerProviderFactory factory, Message message) { Object rootInstance = message.getExchange().remove(JAXRSUtils.ROOT_INSTANCE); if (rootInstance != null) { Object rootProvider = message.getExchange().remove(JAXRSUtils.ROOT_PROVIDER); if (rootProvider != null) { try { ((ResourceProvider)rootProvider).releaseInstance(message, rootInstance); } catch (Throwable tex) { // ignore } } } clearThreadLocalProxies(factory, message); }
private ResourceProvider getResourceProvider(Exchange exchange) { Object provider = exchange.remove(JAXRSUtils.ROOT_PROVIDER); if (provider == null) { OperationResourceInfo ori = exchange.get(OperationResourceInfo.class); ClassResourceInfo cri = ori.getClassResourceInfo(); return cri.getResourceProvider(); } return (ResourceProvider)provider; }
private ResourceProvider getResourceProvider(Exchange exchange) { Object provider = exchange.remove(JAXRSUtils.ROOT_PROVIDER); if (provider == null) { OperationResourceInfo ori = exchange.get(OperationResourceInfo.class); ClassResourceInfo cri = ori.getClassResourceInfo(); return cri.getResourceProvider(); } else { return (ResourceProvider)provider; } }
public Object getServiceObject(Exchange exchange) { Object root = exchange.remove(JAXRSUtils.ROOT_INSTANCE); if (root != null) { return root; } OperationResourceInfo ori = exchange.get(OperationResourceInfo.class); ClassResourceInfo cri = ori.getClassResourceInfo(); return cri.getResourceProvider().getInstance(exchange.getInMessage()); }
public Object getServiceObject(Exchange exchange) { Object root = exchange.remove(JAXRSUtils.ROOT_INSTANCE); if (root != null) { return root; } OperationResourceInfo ori = exchange.get(OperationResourceInfo.class); ClassResourceInfo cri = ori.getClassResourceInfo(); return cri.getResourceProvider().getInstance(exchange.getInMessage()); }
public void handleMessage(Message message) throws Fault { AssertionInfoMap aim = message.get(AssertionInfoMap.class); // extract Assertion information if (aim != null) { Collection<AssertionInfo> ais = PolicyUtils.getAllAssertionsByLocalname(aim, SPConstants.ISSUED_TOKEN); if (ais.isEmpty()) { return; } IssuedToken itok = (IssuedToken)ais.iterator().next().getAssertion(); assertIssuedToken(itok, aim); if (!isRequestor(message)) { message.getExchange().remove(SecurityConstants.TOKEN); List<WSHandlerResult> results = CastUtils.cast((List<?>)message.get(WSHandlerConstants.RECV_RESULTS)); if (results != null && !results.isEmpty()) { parseHandlerResults(results.get(0), message, ais); } } else { for (AssertionInfo ai : ais) { ai.setAsserted(true); } } } }
public static void closeConduit(Exchange exchange) throws IOException { ConduitSelector conduitSelector = null; synchronized (exchange) { conduitSelector = exchange.get(ConduitSelector.class); if (conduitSelector != null) { exchange.remove(ConduitSelector.class.getName()); } } Conduit selectedConduit = null; Message message = exchange.getInMessage() == null ? exchange .getOutMessage() : exchange.getInMessage(); if (conduitSelector != null && message != null) { selectedConduit = conduitSelector.selectConduit(message); selectedConduit.close(message); } //TODO the line below was removed, check the impact on the protobuffer importer/exporter //selectedConduit.close(message); }
public void handleMessage(Message message) throws Fault { AssertionInfoMap aim = message.get(AssertionInfoMap.class); // extract Assertion information if (aim != null) { Collection<AssertionInfo> ais = PolicyUtils.getAllAssertionsByLocalname(aim, SPConstants.ISSUED_TOKEN); if (ais.isEmpty()) { return; } IssuedToken itok = (IssuedToken)ais.iterator().next().getAssertion(); assertIssuedToken(itok, aim); if (!isRequestor(message)) { message.getExchange().remove(SecurityConstants.TOKEN); List<WSHandlerResult> results = CastUtils.cast((List<?>)message.get(WSHandlerConstants.RECV_RESULTS)); if (results != null && !results.isEmpty()) { parseHandlerResults(results.get(0), message, ais); } } else { for (AssertionInfo ai : ais) { ai.setAsserted(true); } } } }
public void removeToken(Message message, SecurityToken securityToken) { // Remove token from cache message.getExchange().getEndpoint().remove(SecurityConstants.TOKEN); message.getExchange().getEndpoint().remove(SecurityConstants.TOKEN_ID); message.getExchange().remove(SecurityConstants.TOKEN_ID); message.getExchange().remove(SecurityConstants.TOKEN); message.resetContextCache(); if (securityToken != null) { TokenStoreUtils.getTokenStore(message).remove(securityToken.getId()); } }
public void removeToken(Message message, SecurityToken securityToken) { // Remove token from cache message.getExchange().getEndpoint().remove(SecurityConstants.TOKEN); message.getExchange().getEndpoint().remove(SecurityConstants.TOKEN_ID); message.getExchange().remove(SecurityConstants.TOKEN_ID); message.getExchange().remove(SecurityConstants.TOKEN); message.resetContextCache(); if (securityToken != null) { TokenStoreUtils.getTokenStore(message).remove(securityToken.getId()); } }
/** * override the super class method */ public void onMessage(Message m) { if (m.get(Message.INBOUND_MESSAGE).equals(Boolean.TRUE)) { //it's outbound fault observer so only take care of outbound fault return; } Exception ex = m.getContent(Exception.class); // remove callback so that it won't be invoked twice ClientCallback callback = m.getExchange().remove(ClientCallback.class); if (callback != null) { Map<String, Object> resCtx = CastUtils.cast((Map<?, ?>) m.getExchange().getOutMessage().get( Message.INVOCATION_CONTEXT)); resCtx = CastUtils.cast((Map<?, ?>) resCtx.get(Client.RESPONSE_CONTEXT)); callback.handleException(resCtx, ex); } }
/** * override the super class method */ public void onMessage(Message m) { if (m.get(Message.INBOUND_MESSAGE).equals(Boolean.TRUE)) { //it's outbound fault observer so only take care of outbound fault return; } Exception ex = m.getContent(Exception.class); // remove callback so that it won't be invoked twice ClientCallback callback = m.getExchange().remove(ClientCallback.class); if (callback != null) { Map<String, Object> resCtx = CastUtils.cast((Map<?, ?>) m.getExchange().getOutMessage().get( Message.INVOCATION_CONTEXT)); resCtx = CastUtils.cast((Map<?, ?>) resCtx.get(Client.RESPONSE_CONTEXT)); callback.handleException(resCtx, ex); } }
public void handleMessage(Message message) throws Fault { String action = (String)message.get(SoapBindingConstants.SOAP_ACTION); if (action == null) { AddressingProperties inProps = (AddressingProperties)message .getContextualProperty(JAXWSAConstants.ADDRESSING_PROPERTIES_INBOUND); if (inProps != null && inProps.getAction() != null) { action = inProps.getAction().getValue(); } } if ("http://schemas.xmlsoap.org/ws/2004/09/transfer/Get".equals(action) || "http://schemas.xmlsoap.org/ws/2004/09/mex/GetMetadata/Request".equals(action)) { message.remove(AssertionInfoMap.class.getName()); Exchange ex = message.getExchange(); Endpoint endpoint = createEndpoint(message); ex.put(Endpoint.class, endpoint); ex.put(Service.class, endpoint.getService()); ex.put(org.apache.cxf.binding.Binding.class, endpoint.getBinding()); ex.put(BindingOperationInfo.class, endpoint.getBinding().getBindingInfo() .getOperation(new QName("http://mex.ws.cxf.apache.org/", "Get2004"))); ex.remove(BindingOperationInfo.class); message.put(MAPAggregator.ACTION_VERIFIED, Boolean.TRUE); message.getInterceptorChain().add(endpoint.getInInterceptors()); message.getInterceptorChain().add(endpoint.getBinding().getInInterceptors()); } }
public void handleMessage(Message message) throws Fault { String action = (String)message.get(SoapBindingConstants.SOAP_ACTION); if (action == null) { AddressingProperties inProps = (AddressingProperties)message .getContextualProperty(JAXWSAConstants.ADDRESSING_PROPERTIES_INBOUND); if (inProps != null && inProps.getAction() != null) { action = inProps.getAction().getValue(); } } if ("http://schemas.xmlsoap.org/ws/2004/09/transfer/Get".equals(action) || "http://schemas.xmlsoap.org/ws/2004/09/mex/GetMetadata/Request".equals(action)) { message.remove(AssertionInfoMap.class.getName()); Exchange ex = message.getExchange(); Endpoint endpoint = createEndpoint(message); ex.put(Endpoint.class, endpoint); ex.put(Service.class, endpoint.getService()); ex.put(org.apache.cxf.binding.Binding.class, endpoint.getBinding()); ex.put(BindingOperationInfo.class, endpoint.getBinding().getBindingInfo() .getOperation(new QName("http://mex.ws.cxf.apache.org/", "Get2004"))); ex.remove(BindingOperationInfo.class); message.put(MAPAggregator.ACTION_VERIFIED, Boolean.TRUE); message.getInterceptorChain().add(endpoint.getInInterceptors()); message.getInterceptorChain().add(endpoint.getBinding().getInInterceptors()); } }
protected boolean performFailover(Exchange exchange, InvocationContext invocation) { Exception prevExchangeFault = (Exception)exchange.remove(Exception.class.getName()); Message outMessage = exchange.getOutMessage(); Exception prevMessageFault = outMessage.getContent(Exception.class);