public abstract class AbstractJDBCLocker extends AbstractLocker
Modifier and Type | Field and Description |
---|---|
protected boolean |
createTablesOnStartup |
protected DataSource |
dataSource |
protected JDBCPersistenceAdapter |
jdbcAdapter |
protected int |
queryTimeout |
DEFAULT_LOCK_ACQUIRE_SLEEP_INTERVAL, failIfLocked, lockable, lockAcquireSleepInterval, name
Constructor and Description |
---|
AbstractJDBCLocker() |
Modifier and Type | Method and Description |
---|---|
protected void |
close(Connection connection) |
protected void |
close(Statement statement) |
void |
configure(PersistenceAdapter adapter)
Optionally configure the locker with the persistence adapter currently used
You can use persistence adapter configuration details like, data directory
datasource, etc.
|
protected Connection |
getConnection() |
int |
getQueryTimeout() |
protected Statements |
getStatements() |
void |
preStart()
handle for various operations before starting the service (like locking)
|
void |
setCreateTablesOnStartup(boolean createTablesOnStartup) |
void |
setDataSource(DataSource dataSource) |
void |
setQueryTimeout(int queryTimeout) |
protected void |
setQueryTimeout(Statement statement) |
void |
setStatements(Statements statements) |
getLockAcquireSleepInterval, keepAlive, setFailIfLocked, setLockable, setLockAcquireSleepInterval, setName
addServiceListener, dispose, doStart, doStop, isStarted, isStopped, isStopping, postStop, removeServiceListener, start, stop
protected DataSource dataSource
protected JDBCPersistenceAdapter jdbcAdapter
protected boolean createTablesOnStartup
protected int queryTimeout
public AbstractJDBCLocker()
public void configure(PersistenceAdapter adapter) throws IOException
Locker
IOException
protected Statements getStatements()
public void setDataSource(DataSource dataSource)
public void setStatements(Statements statements)
protected void setQueryTimeout(Statement statement) throws SQLException
SQLException
public int getQueryTimeout()
public void setQueryTimeout(int queryTimeout)
public void setCreateTablesOnStartup(boolean createTablesOnStartup)
protected Connection getConnection() throws SQLException
SQLException
protected void close(Connection connection)
public void preStart()
ServiceSupport
preStart
in class ServiceSupport
Copyright © 2005–2018 The Apache Software Foundation. All rights reserved.