public void setConduit(Conduit c) { put(ConduitSelector.class, new PreexistingConduitSelector(c, getEndpoint())); }
public void setConduit(Conduit c) { put(ConduitSelector.class, new PreexistingConduitSelector(c, getEndpoint())); }
public void setConduit(Conduit c) { put(ConduitSelector.class, new PreexistingConduitSelector(c, get(Endpoint.class))); }
public void setConduit(Conduit c) { put(ConduitSelector.class, new PreexistingConduitSelector(c, get(Endpoint.class))); }
public void init(Endpoint ep) { if (resourceInstance instanceof Constructor) { Constructor<?> c = (Constructor<?>)resourceInstance; Message m = new MessageImpl(); ExchangeImpl exchange = new ExchangeImpl(); exchange.put(Endpoint.class, ep); m.setExchange(exchange); Object[] values = ResourceUtils.createConstructorArguments(c, m, false, Collections.emptyMap()); try { resourceInstance = values.length > 0 ? c.newInstance(values) : c.newInstance(new Object[]{}); } catch (Exception ex) { throw new ServiceConstructionException(ex); } } if (callPostConstruct) { InjectionUtils.invokeLifeCycleMethod(resourceInstance, ResourceUtils.findPostConstructMethod(ClassHelper.getRealClass(resourceInstance))); } }
cxfExchange.put(Bus.class, endpoint.getBus());
public void run() { ExchangeImpl ex = new ExchangeImpl(); ex.put(Bus.class, destination.getBus()); ex.setInMessage(inMsg); inMsg.setExchange(ex); ex.put(IN_EXCHANGE, exchange); try { destination.getMessageObserver().onMessage(inMsg); } catch (Throwable t) { Message m = inMsg.getExchange().getOutFaultMessage(); if (m == null) { m = inMsg.getExchange().getOutMessage(); } if (m != null) { try { m.put(Message.RESPONSE_CODE, 500); m.put(Message.PROTOCOL_HEADERS, new HashMap<String, List<String>>()); m.getExchange().put(Message.RESPONSE_CODE, 500); m.getContent(OutputStream.class).close(); } catch (IOException e) { //ignore } } } } };
public void run() { ExchangeImpl ex = new ExchangeImpl(); ex.put(Bus.class, destination.getBus()); ex.setInMessage(inMsg); inMsg.setExchange(ex); ex.put(IN_EXCHANGE, exchange); try { destination.getMessageObserver().onMessage(inMsg); } catch (Throwable t) { Message m = inMsg.getExchange().getOutFaultMessage(); if (m == null) { m = inMsg.getExchange().getOutMessage(); } if (m != null) { try { m.put(Message.RESPONSE_CODE, 500); m.put(Message.PROTOCOL_HEADERS, new HashMap<String, List<String>>()); m.getExchange().put(Message.RESPONSE_CODE, 500); m.getContent(OutputStream.class).close(); } catch (IOException e) { //ignore } } } } };
exchange.put(StaxInEndingInterceptor.STAX_IN_NOCLOSE, Boolean.TRUE);
private void dispatchDirect(Message message) throws IOException { if (destination.getMessageObserver() == null) { throw new IllegalStateException("Local destination does not have a MessageObserver on address " + destination.getAddress().getAddress().getValue()); } MessageImpl copy = new MessageImpl(); copy.put(IN_CONDUIT, this); copy.setDestination(destination); transportFactory.copy(message, copy); MessageImpl.copyContent(message, copy); OutputStream out = message.getContent(OutputStream.class); out.flush(); out.close(); CachedOutputStream stream = message.get(CachedOutputStream.class); copy.setContent(InputStream.class, stream.getInputStream()); copy.removeContent(CachedOutputStream.class); stream.releaseTempFileHold(); // Create a new incoming exchange and store the original exchange for the response ExchangeImpl ex = new ExchangeImpl(); ex.setInMessage(copy); ex.put(IN_EXCHANGE, message.getExchange()); ex.put(LocalConduit.DIRECT_DISPATCH, true); ex.setDestination(destination); destination.getMessageObserver().onMessage(copy); }
cxfExchange.put(Bus.class, endpoint.getBus());
private void dispatchDirect(Message message) throws IOException { if (destination.getMessageObserver() == null) { throw new IllegalStateException("Local destination does not have a MessageObserver on address " + destination.getAddress().getAddress().getValue()); } MessageImpl copy = new MessageImpl(); copy.put(IN_CONDUIT, this); copy.setDestination(destination); transportFactory.copy(message, copy); MessageImpl.copyContent(message, copy); OutputStream out = message.getContent(OutputStream.class); out.flush(); out.close(); CachedOutputStream stream = message.get(CachedOutputStream.class); copy.setContent(InputStream.class, stream.getInputStream()); copy.removeContent(CachedOutputStream.class); stream.releaseTempFileHold(); // Create a new incoming exchange and store the original exchange for the response ExchangeImpl ex = new ExchangeImpl(); ex.setInMessage(copy); ex.put(IN_EXCHANGE, message.getExchange()); ex.put(LocalConduit.DIRECT_DISPATCH, true); ex.setDestination(destination); destination.getMessageObserver().onMessage(copy); }