public JAXWSHttpSpiDestination(Bus b, DestinationRegistry registry, EndpointInfo ei) throws IOException { super(b, registry, ei, ei.getAddress(), false); }
private boolean isPrivate(EndpointInfo ei, List<String> privateEndpoints) { if (privateEndpoints != null) { for (String s : privateEndpoints) { if (ei.getAddress().endsWith(s)) { return true; } } } return false; }
protected String getBasePath(String contextPath) throws IOException { if (StringUtils.isEmpty(endpointInfo.getAddress())) { return ""; } return new URL(endpointInfo.getAddress()).getPath(); }
public AbstractHTTPDestination createDestination(EndpointInfo endpointInfo, Bus bus, DestinationRegistry registry) throws IOException { return new ServletDestination(bus, registry, endpointInfo, endpointInfo.getAddress()); } }
private void setupEndpointAddressContext(Endpoint endpoint) { // NOTE for jms transport the address would be null if (null != endpoint && null != endpoint.getEndpointInfo().getAddress()) { getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpoint.getEndpointInfo().getAddress()); } }
public synchronized void addDestination(AbstractHTTPDestination destination) { String path = getTrimmedPath(destination.getEndpointInfo().getAddress()); AbstractHTTPDestination dest = destinations.putIfAbsent(path, destination); if (dest != null && dest != destination) { throw new RuntimeException("Already a destination on " + path); } try { String path2 = URLDecoder.decode(path, "UTF-8"); if (!path.equals(path2)) { decodedDestinations.put(path2, destination); } } catch (UnsupportedEncodingException e) { throw new RuntimeException("Unsupported Encoding", e); } }
private void setupEndpointAddressContext(Endpoint endpoint) { //NOTE for jms transport the address would be null if (null != endpoint && null != endpoint.getEndpointInfo().getAddress()) { Map<String, Object> requestContext = new WrappedMessageContext(client.getRequestContext(), null, Scope.APPLICATION); requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpoint.getEndpointInfo().getAddress()); } } public T invoke(T obj) {
private String getAbsoluteAddress(String basePath, AbstractDestination d) { String endpointAddress = (String)d.getEndpointInfo().getProperty("publishedEndpointUrl"); if (endpointAddress != null) { return endpointAddress; } endpointAddress = d.getEndpointInfo().getAddress(); if (endpointAddress.startsWith("http://") || endpointAddress.startsWith("https://")) { if (endpointAddress.startsWith(basePath) || showForeignContexts) { return endpointAddress; } return null; } String address = basePath; if (address.endsWith("/") && endpointAddress.startsWith("/")) { address = address.substring(0, address.length() - 1); } return address + endpointAddress; }
protected static EndpointInfo getAddressValue(EndpointInfo ei, boolean dp) { if (dp) { String eiAddress = ei.getAddress(); if (eiAddress == null) { try { ServerSocket s = new ServerSocket(0); ei.setAddress("http://localhost:" + s.getLocalPort()); s.close(); return ei; } catch (IOException ex) { // problem allocating a random port, go to the default one ei.setAddress("http://localhost"); } } String addr = StringUtils.addDefaultPortIfMissing(ei.getAddress()); if (addr != null) { ei.setAddress(addr); } } return ei; }
private String getAbsoluteAddress(String basePath, AbstractDestination d) { String endpointAddress = (String)d.getEndpointInfo().getProperty("publishedEndpointUrl"); if (endpointAddress != null) { return endpointAddress; } endpointAddress = d.getEndpointInfo().getAddress(); if (d instanceof ServletDestination && (endpointAddress.startsWith("http://") || endpointAddress.startsWith("https://"))) { String path = ((ServletDestination)d).getPath(); return basePath + path; } else if (basePath == null || endpointAddress.startsWith(basePath)) { return endpointAddress; } else { return basePath + endpointAddress; } } }
try { synchronized (registry) { AbstractHTTPDestination d = registry.getDestinationForPath(endpointInfo.getAddress()); if (d == null) { HttpDestinationFactory jettyFactory = bus.getExtension(HttpDestinationFactory.class); String addr = endpointInfo.getAddress(); if (jettyFactory == null && addr != null && addr.startsWith("http")) { String m =
/** * @return the default target address */ public String getAddress() { if (defaultAddress != null) { return defaultAddress.getString(); } else if (fromEndpointReferenceType) { return getTarget().getAddress().getValue(); } return endpointInfo.getAddress(); }
private boolean addressChanged(String address) { return !(address == null || getClient().getEndpoint().getEndpointInfo() == null || address.equals(getClient().getEndpoint().getEndpointInfo().getAddress())); }
private Address setAndGetDefaultAddress() throws URISyntaxException { if (defaultAddress == null) { synchronized (this) { if (defaultAddress == null) { if (fromEndpointReferenceType && getTarget().getAddress().getValue() != null) { defaultAddress = new Address(this.getTarget().getAddress().getValue()); } else if (endpointInfo.getAddress() != null) { defaultAddress = new Address(endpointInfo.getAddress()); } } } } return defaultAddress; }
protected void updateDestination(HttpServletRequest request, String base, AbstractHTTPDestination d) { String ad = d.getEndpointInfo().getAddress(); if (ad == null && d.getAddress() != null && d.getAddress().getAddress() != null) { ad = d.getAddress().getAddress().getValue(); if (ad == null) { ad = "/"; } } // Using HTTP_PREFIX check is safe for ServletController // URI.create(ad).isRelative() can be used - a bit more expensive though if (ad != null && !ad.startsWith(HTTP_PREFIX)) { if (disableAddressUpdates) { request.setAttribute("org.apache.cxf.transport.endpoint.address", base + ad); } else { BaseUrlHelper.setAddress(d, base + ad); } } }
addressElements.get(0).setTextContent(this.endpoint.getEndpointInfo().getAddress()); builder.address(this.endpoint.getEndpointInfo().getAddress());
for (EndpointInfo ei : si.getEndpoints()) { String bindingID = BindingID.getJaxwsBindingID(ei.getTransportId()); addPort(ei.getName(), bindingID, ei.getAddress());
if (portInfo != null && portInfo.getAddress() != null && !portInfo.getAddress().equals(ei.getAddress())) { ei.setAddress(portInfo.getAddress());
builder.address(ep.getEndpointInfo().getAddress()); builder.serviceName(ep.getService().getName()); builder.endpointName(ep.getEndpointInfo().getName()); URI wsdlDescription = ep.getEndpointInfo().getProperty("URI", URI.class); if (wsdlDescription == null) { String address = ep.getEndpointInfo().getAddress(); try { wsdlDescription = new URI(address + "?wsdl");
@Override public void handle(HttpExchange exchange) throws IOException { try { //Update address in EndpointInfo; this can only happen here, //as the contextPath is provided in the HttpExchange only EndpointInfo ei = destination.getEndpointInfo(); if (ei != null) { String ad = ei.getAddress(); String path = exchange.getHttpContext().getPath(); if (ad != null && ad.equals(path)) { synchronized (ei) { String contextPath = exchange.getContextPath(); ei.setAddress(contextPath + path); if (ei.getExtensor(AddressType.class) != null) { ei.getExtensor(AddressType.class).setLocation(contextPath + path); } else if (ei.getExtensor(SoapAddress.class) != null) { ei.getExtensor(SoapAddress.class).setLocationURI(contextPath + path); } } } } //service request destination.doService(new HttpServletRequestAdapter(exchange), new HttpServletResponseAdapter(exchange)); } finally { exchange.close(); } }