src/share/classes/java/rmi/server/UID.java

Print this page
rev 10048 : 8044740: Convert all JDK versions used in @since tag to 1.n[.n] in jdk repo
Reviewed-by:


  49  * process identifier),
  50  *  or zero for a well-known <code>UID</code>
  51  * <li><code>time</code>, a <code>long</code> equal to a time (as returned
  52  * by {@link System#currentTimeMillis()}) at which the VM that this
  53  * <code>UID</code> was generated in was alive,
  54  * or zero for a well-known <code>UID</code>
  55  * <li><code>count</code>, a <code>short</code> to distinguish
  56  * <code>UID</code>s generated in the same VM with the same
  57  * <code>time</code> value
  58  * </ul>
  59  *
  60  * <p>An independently generated <code>UID</code> instance is unique
  61  * over time with respect to the host it is generated on as long as
  62  * the host requires more than one millisecond to reboot and its system
  63  * clock is never set backward.  A globally unique identifier can be
  64  * constructed by pairing a <code>UID</code> instance with a unique host
  65  * identifier, such as an IP address.
  66  *
  67  * @author      Ann Wollrath
  68  * @author      Peter Jones
  69  * @since       JDK1.1
  70  */
  71 public final class UID implements Serializable {
  72 
  73     private static int hostUnique;
  74     private static boolean hostUniqueSet = false;
  75 
  76     private static final Object lock = new Object();
  77     private static long lastTime = System.currentTimeMillis();
  78     private static short lastCount = Short.MIN_VALUE;
  79 
  80     /** indicate compatibility with JDK 1.1.x version of class */
  81     private static final long serialVersionUID = 1086053664494604050L;
  82 
  83     /**
  84      * number that uniquely identifies the VM that this <code>UID</code>
  85      * was generated in with respect to its host and at the given time
  86      * @serial
  87      */
  88     private final int unique;
  89 




  49  * process identifier),
  50  *  or zero for a well-known <code>UID</code>
  51  * <li><code>time</code>, a <code>long</code> equal to a time (as returned
  52  * by {@link System#currentTimeMillis()}) at which the VM that this
  53  * <code>UID</code> was generated in was alive,
  54  * or zero for a well-known <code>UID</code>
  55  * <li><code>count</code>, a <code>short</code> to distinguish
  56  * <code>UID</code>s generated in the same VM with the same
  57  * <code>time</code> value
  58  * </ul>
  59  *
  60  * <p>An independently generated <code>UID</code> instance is unique
  61  * over time with respect to the host it is generated on as long as
  62  * the host requires more than one millisecond to reboot and its system
  63  * clock is never set backward.  A globally unique identifier can be
  64  * constructed by pairing a <code>UID</code> instance with a unique host
  65  * identifier, such as an IP address.
  66  *
  67  * @author      Ann Wollrath
  68  * @author      Peter Jones
  69  * @since       1.1
  70  */
  71 public final class UID implements Serializable {
  72 
  73     private static int hostUnique;
  74     private static boolean hostUniqueSet = false;
  75 
  76     private static final Object lock = new Object();
  77     private static long lastTime = System.currentTimeMillis();
  78     private static short lastCount = Short.MIN_VALUE;
  79 
  80     /** indicate compatibility with JDK 1.1.x version of class */
  81     private static final long serialVersionUID = 1086053664494604050L;
  82 
  83     /**
  84      * number that uniquely identifies the VM that this <code>UID</code>
  85      * was generated in with respect to its host and at the given time
  86      * @serial
  87      */
  88     private final int unique;
  89