configServiceName = baseServiceName.append(configServiceName); this.containerName = ((configServiceName.length() > 3) ? configServiceName.getParent() : configServiceName).getSimpleName(); String templateCacheName = (configServiceName.length() > 3) ? configServiceName.getSimpleName() : null; String cacheName = this.configuration.getDeploymentName();
/** * Get the length (in segments) of this service name. * * @return the length */ public int length() { final ServiceName parent = this.parent; return parent == null ? 1 : 1 + parent.length(); }
/** * Get the length (in segments) of this service name. * * @return the length */ public int length() { final ServiceName parent = this.parent; return parent == null ? 1 : 1 + parent.length(); }
/** * Compare two service names lexicographically. * * @param o the other name * @return -1 if this name collates before the argument, 1 if it collates after, or 0 if they are equal */ public int compareTo(final ServiceName o) { if (o == null) { throw new IllegalArgumentException("o is null"); } if (this == o) return 0; final int length1 = length(); final int length2 = o.length(); int res; if (length1 == length2) { return compareTo(o, length1 - 1); } int diff = length1 - length2; if (diff > 0) { ServiceName x; for (x = this; diff > 0; diff--) { x = x.parent; } res = x.compareTo(o, length2 - 1); return res == 0 ? 1 : res; } else { return - o.compareTo(this); } }
/** * Compare two service names lexicographically. * * @param o the other name * @return -1 if this name collates before the argument, 1 if it collates after, or 0 if they are equal */ public int compareTo(final ServiceName o) { if (o == null) { throw new IllegalArgumentException("o is null"); } if (this == o) return 0; final int length1 = length(); final int length2 = o.length(); int res; if (length1 == length2) { return compareTo(o, length1 - 1); } int diff = length1 - length2; if (diff > 0) { ServiceName x; for (x = this; diff > 0; diff--) { x = x.parent; } res = x.compareTo(o, length2 - 1); return res == 0 ? 1 : res; } else { return - o.compareTo(this); } }
private ServiceName getCacheServiceName(ReplicationConfig config) { ServiceName baseServiceName = EmbeddedCacheManagerService.getServiceName(null); String cacheName = (config != null) ? config.getCacheName() : null; ServiceName serviceName = ServiceName.parse((cacheName != null) ? cacheName : DEFAULT_CACHE_CONTAINER); if (!baseServiceName.isParentOf(serviceName)) { serviceName = baseServiceName.append(serviceName); } return (serviceName.length() < 4) ? serviceName.append(CacheContainer.DEFAULT_CACHE_NAME) : serviceName; }
int length = original.length(); ServiceName[] ancestry = new ServiceName[length]; ServiceName sn = original;
int length = original.length(); ServiceName[] ancestry = new ServiceName[length]; ServiceName sn = original;