[jboss-svn-commits] JBL Code SVN: r6324 - labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Sep 20 11:53:08 EDT 2006


Author: kevin.conner at jboss.com
Date: 2006-09-20 11:53:06 -0400 (Wed, 20 Sep 2006)
New Revision: 6324

Modified:
   labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/Uid.java
Log:
Fix for JBTM-127, support for a maximum UID

Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/Uid.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/Uid.java	2006-09-20 15:44:12 UTC (rev 6323)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/Uid.java	2006-09-20 15:53:06 UTC (rev 6324)
@@ -422,6 +422,15 @@
 		if (u == this)
 			return false;
 
+		if (this.equals(u))
+			return false ;
+		
+		if (MAX_UID.equals(this))
+			return false ;
+		
+		if (MAX_UID.equals(u))
+			return true ;
+		
 		if (hostAddr < u.hostAddr)
 			return true;
 		else
@@ -450,6 +459,15 @@
 		if (u == this)
 			return false;
 
+		if (this.equals(u))
+			return false ;
+		
+		if (MAX_UID.equals(this))
+			return true ;
+		
+		if (MAX_UID.equals(u))
+			return false ;
+
 		if (hostAddr > u.hostAddr)
 			return true;
 		else
@@ -495,6 +513,21 @@
 		return NIL_UID;
 	}
 
+	/**
+	 * Return a max Uid (0:0:0:1)
+	 */
+	public static final synchronized Uid maxUid ()
+	{
+		/*
+		 * Only create a single instance of this.
+		 */
+
+		if (MAX_UID == null)
+			MAX_UID = new Uid("0:0:0:1");
+
+		return MAX_UID;
+	}
+
 	/*
 	 * Serialization methods. Similar to buffer packing. If the Uid is invalid
 	 * the an IOException is thrown.
@@ -648,4 +681,5 @@
 
 	private static Uid NIL_UID ;
 
+	private static Uid MAX_UID ;
 }




More information about the jboss-svn-commits mailing list