Package org.apache.activemq.store.jdbc
Class AbstractJDBCLocker
- java.lang.Object
-
- org.apache.activemq.util.ServiceSupport
-
- org.apache.activemq.broker.AbstractLocker
-
- org.apache.activemq.store.jdbc.AbstractJDBCLocker
-
- Direct Known Subclasses:
DefaultDatabaseLocker
,LeaseDatabaseLocker
public abstract class AbstractJDBCLocker extends AbstractLocker
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
createTablesOnStartup
protected DataSource
dataSource
protected JDBCPersistenceAdapter
jdbcAdapter
protected int
queryTimeout
-
Fields inherited from class org.apache.activemq.broker.AbstractLocker
DEFAULT_LOCK_ACQUIRE_SLEEP_INTERVAL, failIfLocked, lockable, lockAcquireSleepInterval, name
-
-
Constructor Summary
Constructors Constructor Description AbstractJDBCLocker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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)
-
Methods inherited from class org.apache.activemq.broker.AbstractLocker
getLockAcquireSleepInterval, keepAlive, setFailIfLocked, setLockable, setLockAcquireSleepInterval, setName
-
Methods inherited from class org.apache.activemq.util.ServiceSupport
addServiceListener, dispose, doStart, doStop, isStarted, isStopped, isStopping, postStop, removeServiceListener, start, stop
-
-
-
-
Field Detail
-
dataSource
protected DataSource dataSource
-
jdbcAdapter
protected JDBCPersistenceAdapter jdbcAdapter
-
createTablesOnStartup
protected boolean createTablesOnStartup
-
queryTimeout
protected int queryTimeout
-
-
Method Detail
-
configure
public void configure(PersistenceAdapter adapter) throws IOException
Description copied from interface:Locker
Optionally configure the locker with the persistence adapter currently used You can use persistence adapter configuration details like, data directory datasource, etc. to be used by the locker- Throws:
IOException
-
getStatements
protected Statements getStatements()
-
setDataSource
public void setDataSource(DataSource dataSource)
-
setStatements
public void setStatements(Statements statements)
-
setQueryTimeout
protected void setQueryTimeout(Statement statement) throws SQLException
- Throws:
SQLException
-
getQueryTimeout
public int getQueryTimeout()
-
setQueryTimeout
public void setQueryTimeout(int queryTimeout)
-
setCreateTablesOnStartup
public void setCreateTablesOnStartup(boolean createTablesOnStartup)
-
getConnection
protected Connection getConnection() throws SQLException
- Throws:
SQLException
-
close
protected void close(Connection connection)
-
close
protected void close(Statement statement)
-
preStart
public void preStart()
Description copied from class:ServiceSupport
handle for various operations before starting the service (like locking)- Overrides:
preStart
in classServiceSupport
-
-