org.objectweb.jorm.facility.naming.generator
Interface LongGen

All Known Subinterfaces:
PLongGen
All Known Implementing Classes:
CompositePLongGen, CompositePLongGen, LongGenIncr, RdbSequenceLongGen

public interface LongGen

Provides a generator of long identifiers and ensures that allocated ones are never proposed again (allocation information is made persistent).

Author:
P. Dechamboux

Method Summary
 long allocateIds(int additional)
          Allocate a range of ids.
 long current()
          return the id that will be assigned next time.
 long genId()
          /** Generates a new long identifier.
 long genId(java.lang.Object conn)
           
 int getIncrement()
           
 void setIncrement(int incr)
           
 

Method Detail

genId

public long genId()
           throws PException
/** Generates a new long identifier.

Returns:
The new identifier.
Throws:
PException

genId

public long genId(java.lang.Object conn)
           throws PException
Throws:
PException

allocateIds

public long allocateIds(int additional)
                 throws PException
Allocate a range of ids.

Parameters:
additional -
Returns:
the last identifier allocated
Throws:
PException

setIncrement

public void setIncrement(int incr)

getIncrement

public int getIncrement()

current

public long current()
return the id that will be assigned next time.