public String toString() { Iterator<Entry<ResourceAddress,HttpBinding>> i = entrySet().iterator(); if (! i.hasNext()) return "{}"; StringBuilder sb = new StringBuilder(); sb.append("{\n"); for (;;) { Entry<ResourceAddress, HttpBinding> e = i.next(); ResourceAddress key = e.getKey(); HttpBinding value = e.getValue(); String location = key.getExternalURI(); String nextProtocol = key.getOption(ResourceAddress.NEXT_PROTOCOL); String nextProtocolStr = nextProtocol == null ? "" : " " + nextProtocol; sb.append(" ").append('[').append(URIUtils.resolve(location, "/")).append(nextProtocolStr).append(']'); sb.append('='); sb.append(value); if (! i.hasNext()) { return sb.append("\n}").toString(); } sb.append(',').append('\n'); } }
protected final ResourceAddress resolve(String oldPath, String newPath) { URI addressURI = getResource(); String externalURI = getExternalURI(); boolean newPathDiffersFromOld = !oldPath.equals(newPath); if ( !newPathDiffersFromOld ) { return this; } boolean shouldResolveNewPath = oldPath.equals(addressURI.getPath()); if (!shouldResolveNewPath) { return this; } URI newResourceURI = addressURI.resolve(newPath); String newExternalURI = URIUtils.resolve(externalURI, newPath); ResourceOptions newOptions = FACTORY.newResourceOptions(this); resolve(oldPath, newPath, newOptions); String externalUriToString = newExternalURI; String newResourceUriToString = URIUtils.uriToString(newResourceURI); return factory.newResourceAddress0(externalUriToString, newResourceUriToString, newOptions); }
if (acceptConstraints == null && "balancer".equals(serviceType)) { if (getPath(transportURI) != null && getPath(transportURI).endsWith("/;e")) { transportURI = resolve(transportURI, getPath(transportURI). substring(0, getPath(transportURI).length() - "/;e".length()));
private ResourceAddress getResourcesAddress(HttpBinding newHttpBinding) { ResourceAddress bindAddress = newHttpBinding.bindAddress(); String location = bindAddress.getExternalURI(); String resourcesURI = URIUtils.resolve(location, "/;resource"); ResourceOptions options = ResourceOptions.FACTORY.newResourceOptions(); options.setOption(TRANSPORT_URI, bindAddress.getOption(TRANSPORT_URI)); options.setOption(TRANSPORT, bindAddress.getOption(TRANSPORT)); options.setOption(TEMP_DIRECTORY, bindAddress.getOption(TEMP_DIRECTORY)); options.setOption(NEXT_PROTOCOL, bindAddress.getOption(NEXT_PROTOCOL)); options.setOption(ORIGIN_SECURITY, bindAddress.getOption(ORIGIN_SECURITY)); options.setOption(GATEWAY_ORIGIN_SECURITY, bindAddress.getOption(GATEWAY_ORIGIN_SECURITY)); options.setOption(BALANCE_ORIGINS, bindAddress.getOption(BALANCE_ORIGINS)); return addressFactory.newResourceAddress(resourcesURI, options); }