servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r513687 - /incubator/servicemix/branches/servicemix-3.1/core/servicemix-services/src/main/java/org/apache/servicemix/id/IdGenerator.java
Date Fri, 02 Mar 2007 10:12:49 GMT
Author: gnodet
Date: Fri Mar  2 02:12:48 2007
New Revision: 513687

URL: http://svn.apache.org/viewvc?view=rev&rev=513687
Log:
SM-863: Generated ids are too long

Modified:
    incubator/servicemix/branches/servicemix-3.1/core/servicemix-services/src/main/java/org/apache/servicemix/id/IdGenerator.java

Modified: incubator/servicemix/branches/servicemix-3.1/core/servicemix-services/src/main/java/org/apache/servicemix/id/IdGenerator.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/servicemix-3.1/core/servicemix-services/src/main/java/org/apache/servicemix/id/IdGenerator.java?view=diff&rev=513687&r1=513686&r2=513687
==============================================================================
--- incubator/servicemix/branches/servicemix-3.1/core/servicemix-services/src/main/java/org/apache/servicemix/id/IdGenerator.java
(original)
+++ incubator/servicemix/branches/servicemix-3.1/core/servicemix-services/src/main/java/org/apache/servicemix/id/IdGenerator.java
Fri Mar  2 02:12:48 2007
@@ -54,9 +54,9 @@
 		
 		if ( canAccessSystemProps) {
 			try {
-				hostName = InetAddress.getLocalHost().getHostName();
+				hostName = InetAddress.getLocalHost().getHostAddress();
 				ServerSocket ss = new ServerSocket(0);
-				stub=hostName + "-" + ss.getLocalPort() + "-" + System.currentTimeMillis() + "-";
+				stub=hostName + "-" + Long.toHexString(ss.getLocalPort() ^ System.currentTimeMillis())
+ "-";
 				Thread.sleep(100);
 				ss.close();
 			}catch(Exception ioe){
@@ -64,7 +64,7 @@
 			}
 		}else{
             hostName="localhost";
-			stub = hostName + "-1-" +System.currentTimeMillis() +"-";
+			stub = hostName + Long.toHexString(System.currentTimeMillis()) +"-";
 		}
 		UNIQUE_STUB = stub;
 	}



Mime
View raw message