DestinationFactory df = dfm.getDestinationFactoryForUri(address);
@Override protected String detectTransportIdFromAddress(String ad) { DestinationFactory df = getDestinationFactory(); if (df == null) { DestinationFactoryManager dfm = getBus().getExtension(DestinationFactoryManager.class); df = dfm.getDestinationFactoryForUri(getAddress()); if (df != null) { return df.getTransportIds().get(0); } } return null; }
@Override protected String detectTransportIdFromAddress(String ad) { DestinationFactory df = getDestinationFactory(); if (df == null) { DestinationFactoryManager dfm = getBus().getExtension(DestinationFactoryManager.class); df = dfm.getDestinationFactoryForUri(getAddress()); if (df != null) { return df.getTransportIds().get(0); } } return null; }
@Override protected Client createClient() throws CreateException, Exception { String uri = getAddress(); int idx = uri.indexOf('?'); if (idx != -1) { uri = uri.substring(0, idx); } // remove username/password idx = uri.indexOf('@'); int slashIdx = uri.indexOf("//"); if (idx != -1 && slashIdx != -1) { uri = uri.substring(0, slashIdx + 2) + uri.substring(idx + 1); } EndpointInfo ei = new EndpointInfo(); ei.setAddress(uri); DestinationFactoryManager dfm = getBus().getExtension(DestinationFactoryManager.class); DestinationFactory df = dfm.getDestinationFactoryForUri(uri); if (df == null) { throw new Exception("Could not find a destination factory for uri " + uri); } Destination dest = df.getDestination(ei); MessageObserver mo = dest.getMessageObserver(); if (mo instanceof ChainInitiationObserver) { ChainInitiationObserver cMo = (ChainInitiationObserver) mo; Endpoint cxfEP = cMo.getEndpoint(); return new ClientImpl(getBus(), cxfEP); } else { throw new Exception("Could not create client! No Server was found directly on the endpoint: " + uri); } }
destinationFactory = mgr.getDestinationFactory(mapTransportURI(transId, address)); } else { destinationFactory = mgr.getDestinationFactoryForUri(address);
destinationFactory = mgr.getDestinationFactory(mapTransportURI(transId, address)); } else { destinationFactory = mgr.getDestinationFactoryForUri(address);
DestinationFactory df = dfm.getDestinationFactoryForUri(uri); if (df == null)
/** * @param address the address * @return a Destination for the address */ private Destination getDestination(Bus bus, String address, Message message) throws IOException { Destination destination = null; DestinationFactoryManager factoryManager = bus.getExtension(DestinationFactoryManager.class); DestinationFactory factory = factoryManager.getDestinationFactoryForUri(address); if (factory != null) { Endpoint ep = message.getExchange().getEndpoint(); EndpointInfo ei = new EndpointInfo(); ei.setName(new QName(ep.getEndpointInfo().getName().getNamespaceURI(), ep.getEndpointInfo().getName().getLocalPart() + ".decoupled")); ei.setAddress(address); destination = factory.getDestination(ei, bus); Conduit conduit = ContextUtils.getConduit(null, message); if (conduit != null) { MessageObserver ob = conduit.getMessageObserver(); ob = new InterposedMessageObserver(bus, ob); destination.setMessageObserver(ob); } } return destination; } protected static class InterposedMessageObserver implements MessageObserver {
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); } }
/** * @param address the address * @return a Destination for the address */ private Destination getDestination(Bus bus, String address, Message message) throws IOException { Destination destination = null; DestinationFactoryManager factoryManager = bus.getExtension(DestinationFactoryManager.class); DestinationFactory factory = factoryManager.getDestinationFactoryForUri(address); if (factory != null) { Endpoint ep = message.getExchange().getEndpoint(); EndpointInfo ei = new EndpointInfo(); ei.setName(new QName(ep.getEndpointInfo().getName().getNamespaceURI(), ep.getEndpointInfo().getName().getLocalPart() + ".decoupled")); ei.setAddress(address); destination = factory.getDestination(ei, bus); Conduit conduit = ContextUtils.getConduit(null, message); if (conduit != null) { MessageObserver ob = conduit.getMessageObserver(); ob = new InterposedMessageObserver(bus, ob); destination.setMessageObserver(ob); } } return destination; } protected static class InterposedMessageObserver implements MessageObserver {
if (ei.getAddress() != null && ei.getAddress().indexOf("local://") != -1) { destinationFactory = bus.getExtension(DestinationFactoryManager.class) .getDestinationFactoryForUri(ei.getAddress());
if (ei.getAddress() != null && ei.getAddress().indexOf("local://") != -1) { destinationFactory = bus.getExtension(DestinationFactoryManager.class) .getDestinationFactoryForUri(ei.getAddress());
if (ei.getAddress() != null && ei.getAddress().indexOf("local://") != -1) { destinationFactory = bus.getExtension(DestinationFactoryManager.class) .getDestinationFactoryForUri(ei.getAddress());
if (ei.getAddress() != null && ei.getAddress().indexOf("local://") != -1) { destinationFactory = bus.getExtension(DestinationFactoryManager.class) .getDestinationFactoryForUri(ei.getAddress());
DestinationFactory df = dfm.getDestinationFactoryForUri(address);
DestinationFactory df = dfm.getDestinationFactoryForUri(serviceUri);
protected EndpointInfo createEndpointInfo() throws BusException { String transportId = getTransportId(); 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); } } // default to http transport if (transportId == null) { transportId = "http://schemas.xmlsoap.org/wsdl/soap/http"; } setTransportId(transportId); EndpointInfo ei = new EndpointInfo(); ei.setTransportId(transportId); ei.setName(serviceFactory.getService().getName()); ei.setAddress(getAddress()); ei.setProperty(PROTOBUF_MESSAGE_CLASS, messageClass); BindingInfo bindingInfo = createBindingInfo(); ei.setBinding(bindingInfo); return ei; }
if (df == null) { DestinationFactoryManager dfm = getBus().getExtension(DestinationFactoryManager.class); df = dfm.getDestinationFactoryForUri(getAddress()); super.setDestinationFactory(df);
if (df == null) { DestinationFactoryManager dfm = getBus().getExtension(DestinationFactoryManager.class); df = dfm.getDestinationFactoryForUri(getAddress()); super.setDestinationFactory(df);