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 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)Optionally configure the locker with the persistence adapter currently used You can use persistence adapter configuration details like, data directory datasource, etc.protected ConnectiongetConnection()intgetQueryTimeout()protected StatementsgetStatements()voidpreStart()handle for various operations before starting the service (like locking)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
-
-
Method Detail
-
configure
public void configure(PersistenceAdapter adapter) throws IOException
Description copied from interface:LockerOptionally 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:ServiceSupporthandle for various operations before starting the service (like locking)- Overrides:
preStartin classServiceSupport
-
-