public Destination getDestination(EndpointInfo endpointInfo) throws IOException {
AbstractHTTPDestination d = registry.getDestinationForPath(endpointInfo.getAddress());
if (d == null) {
HttpDestinationFactory jettyFactory = bus.getExtension(HttpDestinationFactory.class);
HttpDestinationFactory servletFactory = new ServletDestinationFactory();
String addr = endpointInfo.getAddress();
HttpDestinationFactory factory = servletFactory;
if (jettyFactory != null && (addr == null || addr.startsWith("http"))) {
factory = jettyFactory;
}