org.apache.activemq.store.jdbc
Class AbstractJDBCLocker

java.lang.Object
  extended by org.apache.activemq.util.ServiceSupport
      extended by org.apache.activemq.broker.AbstractLocker
          extended by org.apache.activemq.store.jdbc.AbstractJDBCLocker
All Implemented Interfaces:
Locker, Service
Direct Known Subclasses:
DefaultDatabaseLocker, LeaseDatabaseLocker

public abstract class AbstractJDBCLocker
extends AbstractLocker


Field Summary
protected  boolean createTablesOnStartup
           
protected  DataSource dataSource
           
protected  int queryTimeout
           
protected  Statements statements
           
 
Fields inherited from class org.apache.activemq.broker.AbstractLocker
DEFAULT_LOCK_ACQUIRE_SLEEP_INTERVAL, failIfLocked, lockable, lockAcquireSleepInterval, name
 
Constructor Summary
AbstractJDBCLocker()
           
 
Method Summary
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()
           
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.activemq.Service
start, stop
 

Field Detail

dataSource

protected DataSource dataSource

statements

protected Statements statements

createTablesOnStartup

protected boolean createTablesOnStartup

queryTimeout

protected int queryTimeout
Constructor Detail

AbstractJDBCLocker

public AbstractJDBCLocker()
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

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 class ServiceSupport


Copyright © 2005–2013 The Apache Software Foundation. All rights reserved.