org.datanucleus.store.valuegenerator
Class AUIDGenerator

java.lang.Object
  extended by org.datanucleus.store.valuegenerator.AbstractGenerator
      extended by org.datanucleus.store.valuegenerator.AbstractUIDGenerator
          extended by org.datanucleus.store.valuegenerator.AUIDGenerator
All Implemented Interfaces:
ValueGenerator

public class AUIDGenerator
extends AbstractUIDGenerator

This generator uses a Java implementation of DCE UUIDs to create unique identifiers without the overhead of additional database transactions or even an open database connection. The identifiers are Strings of the form "LLLLLLLL-MMMM-HHHH-CCCC-NNNNNNNNNNNN" where 'L', 'M', 'H', 'C' and 'N' are the DCE UUID fields named time low, time mid, time high, clock sequence and node.

This generator can be used in concurrent applications. It is especially useful in situations where large numbers of transactions within a certain amount of time have to be made, and the additional overhead of synchronizing the concurrent creation of unique identifiers through the database would break performance limits.

There are no properties for this ValueGenerator.

Note: Due to limitations of the available Java API there is a chance of less than 1:2^62 that two concurrently running JVMs will produce the same identifiers, which is in practical terms never, because your database server will have crashed a million times before this happens.


Field Summary
 
Fields inherited from class org.datanucleus.store.valuegenerator.AbstractGenerator
allocationSize, block, initialValue, LOCALISER, name, properties, repositoryExists
 
Constructor Summary
AUIDGenerator(java.lang.String name, java.util.Properties props)
          Constructor.
 
Method Summary
protected  java.lang.String getIdentifier()
          Accessor for a new identifier.
 
Methods inherited from class org.datanucleus.store.valuegenerator.AbstractUIDGenerator
getStorageClass, reserveBlock
 
Methods inherited from class org.datanucleus.store.valuegenerator.AbstractGenerator
allocate, createRepository, current, currentValue, getName, next, nextValue, obtainGenerationBlock, obtainGenerationBlock, repositoryExists, requiresRepository, reserveBlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AUIDGenerator

public AUIDGenerator(java.lang.String name,
                     java.util.Properties props)
Constructor.

Method Detail

getIdentifier

protected java.lang.String getIdentifier()
Accessor for a new identifier.

Specified by:
getIdentifier in class AbstractUIDGenerator
Returns:
The identifier


Copyright © 2010. All Rights Reserved.