FileDocCategorySizeDatePackage
AbstractUUIDGenerator.javaAPI DocHibernate 3.2.51553Sun Dec 19 09:25:08 GMT 2004org.hibernate.id

AbstractUUIDGenerator

public abstract class AbstractUUIDGenerator extends Object implements IdentifierGenerator
The base class for identifier generators that use a UUID algorithm. This class implements the algorithm, subclasses define the identifier format.
see
UUIDHexGenerator
author
Gavin King

Fields Summary
private static final int
IP
private static short
counter
private static final int
JVM
Constructors Summary
public AbstractUUIDGenerator()


	  
	
Methods Summary
protected shortgetCount()
Unique in a millisecond for this JVM instance (unless there are > Short.MAX_VALUE instances created in a millisecond)

		synchronized(AbstractUUIDGenerator.class) {
			if (counter<0) counter=0;
			return counter++;
		}
	
protected shortgetHiTime()
Unique down to millisecond

		return (short) ( System.currentTimeMillis() >>> 32 );
	
protected intgetIP()
Unique in a local network

		return IP;
	
protected intgetJVM()
Unique across JVMs on this machine (unless they load this class in the same quater second - very unlikely)

		return JVM;
	
protected intgetLoTime()

		return (int) System.currentTimeMillis();