public abstract class AbstractDataSourceBlockIdGenerator extends AbstractDataSourceIdGenerator
| Modifier and Type | Field and Description |
|---|---|
private int |
m_allocated
The number of ids which have been allocated from the current block.
|
private int |
m_blockSize
The number of ids loaded in each block.
|
private java.math.BigDecimal |
m_firstBigDecimal
The first id in a batch of Ids loaded in from the DataSource.
|
private long |
m_firstLong
The first id in a batch of Ids loaded in from the DataSource.
|
m_dataSource, m_nextIdROLE| Constructor and Description |
|---|
AbstractDataSourceBlockIdGenerator() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract java.math.BigDecimal |
allocateBigDecimalIdBlock(int blockSize)
Allocates a block, of the given size, of ids from the database.
|
protected abstract long |
allocateLongIdBlock(int blockSize)
Allocates a block, of the given size, of ids from the database.
|
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration)
Called by the Container to configure the component.
|
protected java.math.BigDecimal |
getNextBigDecimalIdInner()
Gets the next id as a Big Decimal.
|
protected long |
getNextLongIdInner()
Gets the next id as a long.
|
void |
initialize()
Called by the Container to initialize the component.
|
dispose, getConnection, servicegetNextBigDecimalId, getNextByteId, getNextIntegerId, getNextLongId, getNextLongIdChecked, getNextShortId, isUsingBigDecimals, setUseBigDecimalsprivate java.math.BigDecimal m_firstBigDecimal
private long m_firstLong
private int m_blockSize
private int m_allocated
protected abstract java.math.BigDecimal allocateBigDecimalIdBlock(int blockSize)
throws IdException
blockSize - number of Ids which are to be allocated.IdException - if there it was not possible to allocate a block of ids.protected abstract long allocateLongIdBlock(int blockSize)
throws IdException
blockSize - number of Ids which are to be allocated.IdException - if there it was not possible to allocate a block of ids.protected java.math.BigDecimal getNextBigDecimalIdInner()
throws IdException
getNextBigDecimalIdInner in class AbstractIdGeneratorIdException - if an Id could not be allocated for any reason.protected long getNextLongIdInner()
throws IdException
getNextLongIdInner in class AbstractIdGeneratorIdException - if an Id could not be allocated for any reason.public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
throws org.apache.avalon.framework.configuration.ConfigurationException
configure in interface org.apache.avalon.framework.configuration.Configurableconfigure in class AbstractDataSourceIdGeneratorconfiguration - configuration info used to setup the component.org.apache.avalon.framework.configuration.ConfigurationException - if there are any problems with the configuration.public void initialize()
throws java.lang.Exception
initialize in interface org.apache.avalon.framework.activity.Initializableinitialize in class AbstractDataSourceIdGeneratorjava.lang.Exception - if there were any problems durring initialization.