public abstract class AbstractJDBCLocker extends AbstractLocker
Modifier and Type | Field and Description |
---|---|
protected boolean |
createTablesOnStartup |
protected javax.sql.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(java.sql.Connection connection) |
protected void |
close(java.sql.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 java.sql.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(javax.sql.DataSource dataSource) |
void |
setQueryTimeout(int queryTimeout) |
protected void |
setQueryTimeout(java.sql.Statement statement) |
void |
setStatements(Statements statements) |
getLockAcquireSleepInterval, keepAlive, setFailIfLocked, setLockable, setLockAcquireSleepInterval, setName
addServiceListener, dispose, doStart, doStop, isStarted, isStopped, isStopping, postStop, removeServiceListener, start, stop
protected javax.sql.DataSource dataSource
protected JDBCPersistenceAdapter jdbcAdapter
protected boolean createTablesOnStartup
protected int queryTimeout
public void configure(PersistenceAdapter adapter) throws java.io.IOException
Locker
java.io.IOException
protected Statements getStatements()
public void setDataSource(javax.sql.DataSource dataSource)
public void setStatements(Statements statements)
protected void setQueryTimeout(java.sql.Statement statement) throws java.sql.SQLException
java.sql.SQLException
public int getQueryTimeout()
public void setQueryTimeout(int queryTimeout)
public void setCreateTablesOnStartup(boolean createTablesOnStartup)
protected java.sql.Connection getConnection() throws java.sql.SQLException
java.sql.SQLException
protected void close(java.sql.Connection connection)
protected void close(java.sql.Statement statement)
public void preStart()
ServiceSupport
preStart
in class ServiceSupport
Copyright © 2005-2014 Red Hat, Inc.. All Rights Reserved.