|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jpox.store.poid.AbstractPoidGenerator
public abstract class AbstractPoidGenerator
Abstract POID generator.
| Field Summary | |
|---|---|
protected int |
defaultBlockSize
Default block size |
protected static Localiser |
LOCALISER
Localisation of messages |
protected java.lang.String |
name
Symbolic name for the sequence. |
protected PoidBlock |
poidBlock
The current block of ids that have been reserved. |
protected java.util.Properties |
properties
Properties controlling the generator behaviour. |
| Constructor Summary | |
|---|---|
AbstractPoidGenerator(java.lang.String name,
java.util.Properties props)
Constructor. |
|
| Method Summary | |
|---|---|
void |
allocate(int additional)
Method to allocate a number of values into the block. |
protected boolean |
createRepository()
Method to create any needed repository for the ids. |
java.lang.Object |
current()
Accessor for the current value allocated. |
long |
currentValue()
Accessor for the current element in the sequence as a long. |
java.lang.String |
getName()
Accessor for the symbolic name for this generator. |
java.lang.Object |
next()
Get next value from the reserved block of values. |
long |
nextValue()
Accessor for the next element in the sequence as a long. |
protected PoidBlock |
obtainPoidBlock()
Get a new PoidBlock with the default number of ids. |
protected PoidBlock |
obtainPoidBlock(int number)
Get a new PoidBlock with the specified number of ids. |
protected boolean |
requiresRepository()
Indicator for whether the generator requires its own repository. |
protected PoidBlock |
reserveBlock()
Method to reserve a default sized block of identities. |
protected abstract PoidBlock |
reserveBlock(long size)
Method to reserve a blobk of "size" ids. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final Localiser LOCALISER
protected java.lang.String name
protected java.util.Properties properties
protected int defaultBlockSize
protected PoidBlock poidBlock
| Constructor Detail |
|---|
public AbstractPoidGenerator(java.lang.String name,
java.util.Properties props)
name - Symbolic name for this generatorprops - Properties controlling the behaviour of the generator (or null if not required).| Method Detail |
|---|
public java.lang.String getName()
getName in interface javax.jdo.datastore.Sequencepublic java.lang.Object next()
next in interface javax.jdo.datastore.Sequencepublic java.lang.Object current()
current in interface javax.jdo.datastore.Sequencepublic long nextValue()
nextValue in interface javax.jdo.datastore.Sequencejavax.jdo.JDODataStoreException - Thrown if not numericpublic long currentValue()
currentValue in interface javax.jdo.datastore.Sequencejavax.jdo.JDODataStoreException - Thrown if not numericpublic void allocate(int additional)
allocate in interface javax.jdo.datastore.Sequenceadditional - The number to allocateprotected PoidBlock obtainPoidBlock()
protected PoidBlock obtainPoidBlock(int number)
number - The number of additional ids required
protected PoidBlock reserveBlock()
protected abstract PoidBlock reserveBlock(long size)
size - Number of ids to reserve
protected boolean requiresRepository()
protected boolean createRepository()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||