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, setNameaddServiceListener, dispose, doStart, doStop, isStarted, isStopped, isStopping, postStop, removeServiceListener, start, stopprotected DataSource dataSource
protected JDBCPersistenceAdapter jdbcAdapter
protected boolean createTablesOnStartup
protected int queryTimeout
public AbstractJDBCLocker()
public void configure(PersistenceAdapter adapter) throws IOException
LockerIOExceptionprotected Statements getStatements()
public void setDataSource(DataSource dataSource)
public void setStatements(Statements statements)
protected void setQueryTimeout(Statement statement) throws SQLException
SQLExceptionpublic int getQueryTimeout()
public void setQueryTimeout(int queryTimeout)
public void setCreateTablesOnStartup(boolean createTablesOnStartup)
protected Connection getConnection() throws SQLException
SQLExceptionprotected void close(Connection connection)
public void preStart()
ServiceSupportpreStart in class ServiceSupportCopyright © 2005–2016 FuseSource, Corp.. All rights reserved.