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
-
- All Implemented Interfaces:
Locker,org.apache.activemq.Service
- Direct Known Subclasses:
DefaultDatabaseLocker,LeaseDatabaseLocker
public abstract class AbstractJDBCLocker extends AbstractLocker
-
-
Field Summary
Fields Modifier and Type Field Description protected booleancreateTablesOnStartupprotected DataSourcedataSourceprotected JDBCPersistenceAdapterjdbcAdapterprotected intqueryTimeout-
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 voidclose(Connection connection)protected voidclose(Statement statement)voidconfigure(PersistenceAdapter adapter)protected ConnectiongetConnection()intgetQueryTimeout()protected StatementsgetStatements()voidpreStart()voidsetCreateTablesOnStartup(boolean createTablesOnStartup)voidsetDataSource(DataSource dataSource)voidsetQueryTimeout(int queryTimeout)protected voidsetQueryTimeout(Statement statement)voidsetStatements(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
-
-
Constructor Detail
-
AbstractJDBCLocker
public AbstractJDBCLocker()
-
-
Method Detail
-
configure
public void configure(PersistenceAdapter adapter) throws IOException
- 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)
-
preStart
public void preStart()
- Overrides:
preStartin classServiceSupport
-
-