Author: tv Date: Tue Jan 6 18:55:12 2015 New Revision: 1649905 URL: http://svn.apache.org/r1649905 Log: Use util class for all naming URLs
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java Modified: commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java?rev=1649905&r1=1649904&r2=1649905&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java (original) +++ commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java Tue Jan 6 18:55:12 2015 @@ -389,7 +389,7 @@ public class RemoteCacheServerFactory log.info( "Unbinding host=" + host + ", port=" + port + ", serviceName=" + getServiceName() ); try { - Naming.unbind( "//" + host + ":" + port + "/" + getServiceName() ); + Naming.unbind( RemoteUtils.getNamingURL(host, port, getServiceName()) ); } catch ( MalformedURLException ex ) { @@ -448,7 +448,7 @@ public class RemoteCacheServerFactory if ( args.length > 0 && args[0].toLowerCase().indexOf( "-shutdown" ) != -1 ) { String remoteServiceName = prop.getProperty( REMOTE_CACHE_SERVICE_NAME, REMOTE_CACHE_SERVICE_VAL ).trim(); - String registry = "//:" + port + "/" + remoteServiceName; + String registry = RemoteUtils.getNamingURL("", port, remoteServiceName); if ( log.isDebugEnabled() ) { @@ -481,7 +481,7 @@ public class RemoteCacheServerFactory try { String sz = prop.getProperty( REMOTE_CACHE_SERVICE_NAME, REMOTE_CACHE_SERVICE_VAL ).trim(); - String registry = "//:" + port + "/" + sz; + String registry = RemoteUtils.getNamingURL("", port, sz); log.debug( "looking up server " + registry ); Object obj = Naming.lookup( registry ); log.debug( "server found" );