public static String getTransportId(Bus bus, String address) { ConduitInitiatorManager conduitInitiatorMgr = bus .getExtension(ConduitInitiatorManager.class); ConduitInitiator conduitInitiator = null; if (conduitInitiatorMgr != null) { conduitInitiator = conduitInitiatorMgr .getConduitInitiatorForUri(address); } if (conduitInitiator != null) { return conduitInitiator.getTransportIds().get(0); } else { return null; } }
@Override protected String detectTransportIdFromAddress(String ad) { ConduitInitiatorManager cim = getBus().getExtension(ConduitInitiatorManager.class); ConduitInitiator ci = cim.getConduitInitiatorForUri(getAddress()); if (ci != null) { return ci.getTransportIds().get(0); } return null; }
@Override protected String detectTransportIdFromAddress(String ad) { ConduitInitiatorManager cim = getBus().getExtension(ConduitInitiatorManager.class); ConduitInitiator ci = cim.getConduitInitiatorForUri(getAddress()); if (ci != null) { return ci.getTransportIds().get(0); } return null; } @Override
@Override protected String detectTransportIdFromAddress(String ad) { ConduitInitiatorManager cim = getBus().getExtension(ConduitInitiatorManager.class); ConduitInitiator ci = cim.getConduitInitiatorForUri(getAddress()); if (ci != null) { return ci.getTransportIds().get(0); } return null; }
@Override protected String detectTransportIdFromAddress(String ad) { ConduitInitiatorManager cim = getBus().getExtension(ConduitInitiatorManager.class); ConduitInitiator ci = cim.getConduitInitiatorForUri(getAddress()); if (ci != null) { return ci.getTransportIds().get(0); } return null; } @Override
ci = mgr.getConduitInitiatorForUri(base.toString());
public Conduit getConduit(EndpointInfo ei, EndpointReferenceType target, Bus bus) throws IOException { String address = target == null ? ei.getAddress() : target.getAddress().getValue(); BindingInfo bi = ei.getBinding(); String transId = ei.getTransportId(); if (bi instanceof SoapBindingInfo) { transId = ((SoapBindingInfo)bi).getTransportURI(); if (transId == null) { transId = ei.getTransportId(); } } ConduitInitiator conduitInit; try { ConduitInitiatorManager mgr = bus.getExtension(ConduitInitiatorManager.class); if (StringUtils.isEmpty(address) || address.startsWith("http") || address.startsWith("jms") || address.startsWith("soap.udp")) { conduitInit = mgr.getConduitInitiator(mapTransportURI(transId, address)); } else { conduitInit = mgr.getConduitInitiatorForUri(address); } if (conduitInit == null) { throw new RuntimeException(String.format(CANNOT_GET_CONDUIT_ERROR, address, transId)); } return conduitInit.getConduit(ei, target, bus); } catch (BusException e) { throw new RuntimeException(String.format(CANNOT_GET_CONDUIT_ERROR, address, transId)); } }
public Conduit getConduit(EndpointInfo ei, EndpointReferenceType target, Bus bus) throws IOException { String address = target == null ? ei.getAddress() : target.getAddress().getValue(); BindingInfo bi = ei.getBinding(); String transId = ei.getTransportId(); if (bi instanceof SoapBindingInfo) { transId = ((SoapBindingInfo)bi).getTransportURI(); if (transId == null) { transId = ei.getTransportId(); } } ConduitInitiator conduitInit; try { ConduitInitiatorManager mgr = bus.getExtension(ConduitInitiatorManager.class); if (StringUtils.isEmpty(address) || address.startsWith("http") || address.startsWith("jms") || address.startsWith("soap.udp")) { conduitInit = mgr.getConduitInitiator(mapTransportURI(transId, address)); } else { conduitInit = mgr.getConduitInitiatorForUri(address); } if (conduitInit == null) { throw new RuntimeException(String.format(CANNOT_GET_CONDUIT_ERROR, address, transId)); } return conduitInit.getConduit(ei, target, bus); } catch (BusException e) { throw new RuntimeException(String.format(CANNOT_GET_CONDUIT_ERROR, address, transId)); } }
ci = mgr.getConduitInitiatorForUri(address);
private void modifyTransportIdPerAddress(EndpointInfo ei) { //get chance to set transportId according to the the publish address prefix //this is useful for local & camel transport if (transportId == null && getAddress() != null) { DestinationFactory df = getDestinationFactory(); if (df == null) { DestinationFactoryManager dfm = getBus().getExtension( DestinationFactoryManager.class); df = dfm.getDestinationFactoryForUri(getAddress()); } if (df != null) { transportId = df.getTransportIds().get(0); } else { // check conduits (the address could be supported on // client only) ConduitInitiatorManager cim = getBus().getExtension( ConduitInitiatorManager.class); ConduitInitiator ci = cim .getConduitInitiatorForUri(getAddress()); if (ci != null) { transportId = ci.getTransportIds().get(0); } } } if (transportId != null) { ei.setTransportId(transportId); } }
private void modifyTransportIdPerAddress(EndpointInfo ei) { //get chance to set transportId according to the the publish address prefix //this is useful for local & camel transport if (transportId == null && getAddress() != null) { DestinationFactory df = getDestinationFactory(); if (df == null) { DestinationFactoryManager dfm = getBus().getExtension( DestinationFactoryManager.class); df = dfm.getDestinationFactoryForUri(getAddress()); } if (df != null) { transportId = df.getTransportIds().get(0); } else { // check conduits (the address could be supported on // client only) ConduitInitiatorManager cim = getBus().getExtension( ConduitInitiatorManager.class); ConduitInitiator ci = cim .getConduitInitiatorForUri(getAddress()); if (ci != null) { transportId = ci.getTransportIds().get(0); } } } if (transportId != null) { ei.setTransportId(transportId); } }
if (conduitInitiatorMgr != null) { ConduitInitiator conduitInitiator = conduitInitiatorMgr.getConduitInitiatorForUri(address); if (conduitInitiator != null) { EndpointReferenceType epr = new EndpointReferenceType();
public Conduit getBackChannel(Message inMessage) throws IOException { Bus bus = inMessage.getExchange().getBus(); //this is a response targeting a decoupled endpoint. Treat it as a oneway so //we don't wait for a response. inMessage.getExchange().setOneWay(true); ConduitInitiator conduitInitiator = bus.getExtension(ConduitInitiatorManager.class) .getConduitInitiatorForUri(reference.getAddress().getValue()); if (conduitInitiator != null) { Conduit c = conduitInitiator.getConduit(ei, reference, bus); //ensure decoupled back channel input stream is closed c.setMessageObserver(new MessageObserver() { public void onMessage(Message m) { InputStream is = m.getContent(InputStream.class); if (is != null) { try { is.close(); } catch (Exception e) { //ignore } } } }); return c; } return null; } public MessageObserver getMessageObserver() {
public Conduit getBackChannel(Message inMessage) throws IOException { Bus bus = inMessage.getExchange().getBus(); //this is a response targeting a decoupled endpoint. Treat it as a oneway so //we don't wait for a response. inMessage.getExchange().setOneWay(true); ConduitInitiator conduitInitiator = bus.getExtension(ConduitInitiatorManager.class) .getConduitInitiatorForUri(reference.getAddress().getValue()); if (conduitInitiator != null) { Conduit c = conduitInitiator.getConduit(ei, reference, bus); //ensure decoupled back channel input stream is closed c.setMessageObserver(new MessageObserver() { public void onMessage(Message m) { InputStream is = m.getContent(InputStream.class); if (is != null) { try { is.close(); } catch (Exception e) { //ignore } } } }); return c; } return null; } public MessageObserver getMessageObserver() {
public Conduit getBackChannel(Message inMessage, Message partialResponse, EndpointReferenceType address) throws IOException { Bus bus = inMessage.getExchange().get(Bus.class); //this is a response targeting a decoupled endpoint. Treat it as a oneway so //we don't wait for a response. inMessage.getExchange().setOneWay(true); ConduitInitiator conduitInitiator = bus.getExtension(ConduitInitiatorManager.class) .getConduitInitiatorForUri(reference.getAddress().getValue()); if (conduitInitiator != null) { Conduit c = conduitInitiator.getConduit(ei, reference); //ensure decoupled back channel input stream is closed c.setMessageObserver(new MessageObserver() { public void onMessage(Message m) { InputStream is = m.getContent(InputStream.class); if (is != null) { try { is.close(); } catch (Exception e) { //ignore } } } }); return c; } return null; } public MessageObserver getMessageObserver() {
public Conduit getBackChannel(Message inMessage, Message partialResponse, EndpointReferenceType address) throws IOException { Bus bus = inMessage.getExchange().get(Bus.class); //this is a response targeting a decoupled endpoint. Treat it as a oneway so //we don't wait for a response. inMessage.getExchange().setOneWay(true); ConduitInitiator conduitInitiator = bus.getExtension(ConduitInitiatorManager.class) .getConduitInitiatorForUri(reference.getAddress().getValue()); if (conduitInitiator != null) { Conduit c = conduitInitiator.getConduit(ei, reference); //ensure decoupled back channel input stream is closed c.setMessageObserver(new MessageObserver() { public void onMessage(Message m) { InputStream is = m.getContent(InputStream.class); if (is != null) { try { is.close(); } catch (Exception e) { //ignore } } } }); return c; } return null; } public MessageObserver getMessageObserver() {
if (conduitInitiatorMgr != null) { ConduitInitiator conduitInitiator = conduitInitiatorMgr.getConduitInitiatorForUri(address); if (conduitInitiator != null) { EndpointReferenceType epr = new EndpointReferenceType();
public Conduit getBackChannel(Message inMessage) throws IOException { if (ContextUtils.isNoneAddress(reference)) { return null; } Bus bus = inMessage.getExchange().getBus(); //this is a response targeting a decoupled endpoint. Treat it as a oneway so //we don't wait for a response. inMessage.getExchange().setOneWay(true); ConduitInitiator conduitInitiator = bus.getExtension(ConduitInitiatorManager.class) .getConduitInitiatorForUri(reference.getAddress().getValue()); if (conduitInitiator != null) { Conduit c = conduitInitiator.getConduit(ei, reference, bus); // ensure decoupled back channel input stream is closed c.setMessageObserver(new MessageObserver() { public void onMessage(Message m) { InputStream is = m.getContent(InputStream.class); if (is != null) { try { is.close(); } catch (Exception e) { // ignore } } } }); return c; } return null; }
public Conduit getBackChannel(Message inMessage) throws IOException { if (ContextUtils.isNoneAddress(reference)) { return null; } Bus bus = inMessage.getExchange().getBus(); //this is a response targeting a decoupled endpoint. Treat it as a oneway so //we don't wait for a response. inMessage.getExchange().setOneWay(true); ConduitInitiator conduitInitiator = bus.getExtension(ConduitInitiatorManager.class) .getConduitInitiatorForUri(reference.getAddress().getValue()); if (conduitInitiator != null) { Conduit c = conduitInitiator.getConduit(ei, reference, bus); // ensure decoupled back channel input stream is closed c.setMessageObserver(new MessageObserver() { public void onMessage(Message m) { InputStream is = m.getContent(InputStream.class); if (is != null) { try { is.close(); } catch (Exception e) { // ignore } } } }); return c; } return null; }
public Conduit getBackChannel(Message inMessage) throws IOException { if (ContextUtils.isNoneAddress(reference)) { return null; } Bus bus = inMessage.getExchange().getBus(); //this is a response targeting a decoupled endpoint. Treat it as a oneway so //we don't wait for a response. inMessage.getExchange().setOneWay(true); ConduitInitiator conduitInitiator = bus.getExtension(ConduitInitiatorManager.class) .getConduitInitiatorForUri(reference.getAddress().getValue()); if (conduitInitiator != null) { Conduit c = conduitInitiator.getConduit(ei, reference, bus); // ensure decoupled back channel input stream is closed c.setMessageObserver(new MessageObserver() { public void onMessage(Message m) { InputStream is = m.getContent(InputStream.class); if (is != null) { try { is.close(); } catch (Exception e) { // ignore } } } }); return c; } return null; }