com.caucho.amber.idgen
Class IdGenerator

java.lang.Object
  extended by com.caucho.amber.idgen.IdGenerator
Direct Known Subclasses:
AmberTableGenerator, SequenceIdGenerator

public abstract class IdGenerator
extends java.lang.Object

Generator table.


Constructor Summary
IdGenerator()
           
 
Method Summary
 long allocate(AmberConnection aConn)
          Allocates the next id.
abstract  long allocateGroup(AmberConnection aConn)
          Allocates the next group of ids.
 int getGroupSize()
          Gets the group size.
 void setGroupSize(int groupSize)
          Sets the group size.
 void start()
          Starts the generator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdGenerator

public IdGenerator()
Method Detail

getGroupSize

public int getGroupSize()
Gets the group size.


setGroupSize

public void setGroupSize(int groupSize)
Sets the group size.


allocate

public long allocate(AmberConnection aConn)
              throws java.sql.SQLException
Allocates the next id.

Throws:
java.sql.SQLException

allocateGroup

public abstract long allocateGroup(AmberConnection aConn)
                            throws java.sql.SQLException
Allocates the next group of ids.

Throws:
java.sql.SQLException

start

public void start()
Starts the generator