public abstract class AbstractDataSourceIdGenerator extends AbstractIdGenerator implements org.apache.avalon.framework.service.Serviceable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.activity.Disposable
| Modifier and Type | Field and Description |
|---|---|
protected int |
m_allocated
Number of allocated Ids remaining before another block must be allocated.
|
protected DataSourceComponent |
m_dataSource |
private java.lang.String |
m_dataSourceName |
private org.apache.avalon.framework.service.ServiceSelector |
m_dbSelector |
protected long |
m_nextId |
ROLE| Constructor and Description |
|---|
AbstractDataSourceIdGenerator() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration)
Called by the Container to configure the component.
|
void |
dispose()
Called by the Container to dispose the component.
|
protected java.sql.Connection |
getConnection()
Allocates a connection for the caller.
|
void |
initialize()
Called by the Container to initialize the component.
|
void |
service(org.apache.avalon.framework.service.ServiceManager manager)
Called by the Container to tell the component which ComponentLocator
is controlling it.
|
getNextBigDecimalId, getNextBigDecimalIdInner, getNextByteId, getNextIntegerId, getNextLongId, getNextLongIdChecked, getNextLongIdInner, getNextShortId, isUsingBigDecimals, setUseBigDecimalsprivate java.lang.String m_dataSourceName
private org.apache.avalon.framework.service.ServiceSelector m_dbSelector
protected DataSourceComponent m_dataSource
protected int m_allocated
protected long m_nextId
protected java.sql.Connection getConnection()
throws java.sql.SQLException
java.sql.SQLException - if the connection can not be obtained for any reason.public void service(org.apache.avalon.framework.service.ServiceManager manager)
throws org.apache.avalon.framework.service.ServiceException
service in interface org.apache.avalon.framework.service.Serviceablemanager - which curently owns the component.org.apache.avalon.framework.service.ServiceExceptionpublic void configure(org.apache.avalon.framework.configuration.Configuration configuration)
throws org.apache.avalon.framework.configuration.ConfigurationException
configure in interface org.apache.avalon.framework.configuration.Configurableconfiguration - 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.Initializablejava.lang.Exception - if there were any problems durring initialization.public void dispose()
dispose in interface org.apache.avalon.framework.activity.Disposable