@Override public ConduitSelector getConduitSelector() { return config.getConduitSelector(); }
@Override public ConduitSelector getConduitSelector() { return config.getConduitSelector(); }
@Override public ConduitSelector getConduitSelector() { return config.getConduitSelector(); }
void prepareConduitSelector(Message message) { try { getConduitSelector().prepare(message); } catch (Fault ex) { LOG.fine("Failure to prepare a message from conduit selector"); } }
void prepareConduitSelector(Message message) { try { getConduitSelector().prepare(message); } catch (Fault ex) { LOG.fine("Failure to prepare a message from conduit selector"); } }
void prepareConduitSelector(Message message) { try { getConduitSelector().prepare(message); } catch (Fault ex) { LOG.fine("Failure to prepare a message from conduit selector"); } }
protected void verifyStrategy(Object proxy, Class<?> clz) { ConduitSelector conduitSelector = WebClient.getConfig(proxy).getConduitSelector(); if (conduitSelector instanceof FailoverTargetSelector) { Object strategy = ((FailoverTargetSelector)conduitSelector).getStrategy(); assertTrue("unexpected strategy", clz.isInstance(strategy)); } else { fail("unexpected conduit selector: " + conduitSelector); } }
protected void verifyStrategy(Object proxy, Class<?> clz) { ConduitSelector conduitSelector = WebClient.getConfig(proxy).getConduitSelector(); if (conduitSelector instanceof FailoverTargetSelector) { Object strategy = ((FailoverTargetSelector)conduitSelector).getStrategy(); assertTrue("unexpected strategy", clz.isInstance(strategy)); } else { fail("unexpected conduit selector: " + conduitSelector); } }
protected Object[] preProcessResult(Message message) throws Exception { Exchange exchange = message.getExchange(); Exception ex = message.getContent(Exception.class); if (ex != null || PropertyUtils.isTrue(exchange.get(SERVICE_NOT_AVAIL_PROPERTY)) && PropertyUtils.isTrue(exchange.get(COMPLETE_IF_SERVICE_NOT_AVAIL_PROPERTY))) { getConfiguration().getConduitSelector().complete(exchange); } if (ex != null) { checkClientException(message, ex); } checkClientException(message, exchange.get(Exception.class)); List<?> result = exchange.get(List.class); return result != null ? result.toArray() : null; }
protected String getCurrentEndpointAddress(Object client) { return WebClient.getConfig(client).getConduitSelector() .getEndpoint().getEndpointInfo().getAddress(); }
/** * Gets the conduit responsible for a transport-level * communication with the remote service. * @return the conduit */ public Conduit getConduit() { Message message = new MessageImpl(); Exchange exchange = new ExchangeImpl(); message.setExchange(exchange); exchange.put(MessageObserver.class, new ClientMessageObserver(this)); if (conduitSelector != null) { exchange.put(Endpoint.class, conduitSelector.getEndpoint()); } exchange.put(Bus.class, bus); prepareConduitSelector(message); return getConduitSelector().selectConduit(message); }
protected static PhaseInterceptorChain setupInInterceptorChain(ClientConfiguration cfg) { PhaseManager pm = cfg.getBus().getExtension(PhaseManager.class); List<Interceptor<? extends Message>> i1 = cfg.getBus().getInInterceptors(); List<Interceptor<? extends Message>> i2 = cfg.getInInterceptors(); List<Interceptor<? extends Message>> i3 = cfg.getConduitSelector().getEndpoint().getInInterceptors(); PhaseInterceptorChain chain = new PhaseChainCache().get(pm.getInPhases(), i1, i2, i3); chain.add(new ClientResponseFilterInterceptor()); return chain; }
protected static PhaseInterceptorChain setupOutInterceptorChain(ClientConfiguration cfg) { PhaseManager pm = cfg.getBus().getExtension(PhaseManager.class); List<Interceptor<? extends Message>> i1 = cfg.getBus().getOutInterceptors(); List<Interceptor<? extends Message>> i2 = cfg.getOutInterceptors(); List<Interceptor<? extends Message>> i3 = cfg.getConduitSelector().getEndpoint().getOutInterceptors(); PhaseInterceptorChain chain = new PhaseChainCache().get(pm.getOutPhases(), i1, i2, i3); chain.add(new ClientRequestFilterInterceptor()); return chain; }
/** * Gets the conduit responsible for a transport-level * communication with the remote service. * @return the conduit */ public Conduit getConduit() { Message message = new MessageImpl(); Exchange exchange = new ExchangeImpl(); message.setExchange(exchange); exchange.put(MessageObserver.class, new ClientMessageObserver(this)); if (conduitSelector != null) { exchange.put(Endpoint.class, conduitSelector.getEndpoint()); } exchange.put(Bus.class, bus); prepareConduitSelector(message); return getConduitSelector().selectConduit(message); }
protected static PhaseInterceptorChain setupOutInterceptorChain(ClientConfiguration cfg) { PhaseManager pm = cfg.getBus().getExtension(PhaseManager.class); List<Interceptor<? extends Message>> i1 = cfg.getBus().getOutInterceptors(); List<Interceptor<? extends Message>> i2 = cfg.getOutInterceptors(); List<Interceptor<? extends Message>> i3 = cfg.getConduitSelector().getEndpoint().getOutInterceptors(); PhaseInterceptorChain chain = new PhaseChainCache().get(pm.getOutPhases(), i1, i2, i3); chain.add(new ClientRequestFilterInterceptor()); return chain; }
protected static PhaseInterceptorChain setupOutInterceptorChain(ClientConfiguration cfg) { PhaseManager pm = cfg.getBus().getExtension(PhaseManager.class); List<Interceptor<? extends Message>> i1 = cfg.getBus().getOutInterceptors(); List<Interceptor<? extends Message>> i2 = cfg.getOutInterceptors(); List<Interceptor<? extends Message>> i3 = cfg.getConduitSelector().getEndpoint().getOutInterceptors(); PhaseInterceptorChain chain = new PhaseChainCache().get(pm.getOutPhases(), i1, i2, i3); chain.add(new ClientRequestFilterInterceptor()); return chain; }
protected static PhaseInterceptorChain setupInInterceptorChain(ClientConfiguration cfg) { PhaseManager pm = cfg.getBus().getExtension(PhaseManager.class); List<Interceptor<? extends Message>> i1 = cfg.getBus().getInInterceptors(); List<Interceptor<? extends Message>> i2 = cfg.getInInterceptors(); List<Interceptor<? extends Message>> i3 = cfg.getConduitSelector().getEndpoint().getInInterceptors(); PhaseInterceptorChain chain = new PhaseChainCache().get(pm.getInPhases(), i1, i2, i3); chain.add(new ClientResponseFilterInterceptor()); return chain; }
protected static PhaseInterceptorChain setupInInterceptorChain(ClientConfiguration cfg) { PhaseManager pm = cfg.getBus().getExtension(PhaseManager.class); List<Interceptor<? extends Message>> i1 = cfg.getBus().getInInterceptors(); List<Interceptor<? extends Message>> i2 = cfg.getInInterceptors(); List<Interceptor<? extends Message>> i3 = cfg.getConduitSelector().getEndpoint().getInInterceptors(); PhaseInterceptorChain chain = new PhaseChainCache().get(pm.getInPhases(), i1, i2, i3); chain.add(new ClientResponseFilterInterceptor()); return chain; }
protected Exchange createExchange(Message m, Exchange exchange) { if (exchange == null) { exchange = new ExchangeImpl(); } exchange.setSynchronous(true); exchange.setOutMessage(m); exchange.put(Bus.class, cfg.getBus()); exchange.put(MessageObserver.class, new ClientMessageObserver(cfg)); exchange.put(Endpoint.class, cfg.getConduitSelector().getEndpoint()); exchange.put("org.apache.cxf.transport.no_io_exceptions", true); //REVISIT - when response handling is actually put onto the in chain, this will likely not be needed exchange.put(StaxInEndingInterceptor.STAX_IN_NOCLOSE, Boolean.TRUE); m.setExchange(exchange); return exchange; }
protected Exchange createExchange(Message m, Exchange exchange) { if (exchange == null) { exchange = new ExchangeImpl(); } exchange.setSynchronous(true); exchange.setOutMessage(m); exchange.put(Bus.class, cfg.getBus()); exchange.put(MessageObserver.class, new ClientMessageObserver(cfg)); exchange.put(Endpoint.class, cfg.getConduitSelector().getEndpoint()); exchange.put("org.apache.cxf.transport.no_io_exceptions", true); //REVISIT - when response handling is actually put onto the in chain, this will likely not be needed exchange.put(StaxInEndingInterceptor.STAX_IN_NOCLOSE, Boolean.TRUE); m.setExchange(exchange); return exchange; }