org.datanucleus.store.valuegenerator
Class AbstractUIDGenerator

java.lang.Object
  extended by org.datanucleus.store.valuegenerator.AbstractGenerator
      extended by org.datanucleus.store.valuegenerator.AbstractUIDGenerator
All Implemented Interfaces:
ValueGenerator
Direct Known Subclasses:
AbstractUUIDGenerator, AUIDGenerator

public abstract class AbstractUIDGenerator
extends AbstractGenerator

Value generator for a UID format. To be extended by implementations giving the UID in particular forms.


Field Summary
 
Fields inherited from class org.datanucleus.store.valuegenerator.AbstractGenerator
allocationSize, block, initialValue, LOCALISER, name, properties, repositoryExists
 
Constructor Summary
AbstractUIDGenerator(java.lang.String name, java.util.Properties props)
          Constructor.
 
Method Summary
protected abstract  java.lang.String getIdentifier()
          Create an identifier in the UID format required.
static java.lang.Class getStorageClass()
          Accessor for the storage class for values generated with this generator.
protected  ValueGenerationBlock reserveBlock(long size)
          Method to reserve "size" values to the block.
 
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

AbstractUIDGenerator

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

Parameters:
name - Symbolic name for this generator
props - Properties controlling its behaviour
Method Detail

getStorageClass

public static java.lang.Class getStorageClass()
Accessor for the storage class for values generated with this generator.

Returns:
Storage class (in this case String.class)

reserveBlock

protected ValueGenerationBlock reserveBlock(long size)
Method to reserve "size" values to the block.

Specified by:
reserveBlock in class AbstractGenerator
Parameters:
size - The block size
Returns:
The reserved block

getIdentifier

protected abstract java.lang.String getIdentifier()
Create an identifier in the UID format required.

Returns:
The identifier


Copyright © 2010. All Rights Reserved.