org.apache.activemq.store.jdbc
Class DefaultDatabaseLocker
java.lang.Object
org.apache.activemq.store.jdbc.DefaultDatabaseLocker
- All Implemented Interfaces:
- Service, DatabaseLocker
public class DefaultDatabaseLocker
- extends Object
- implements DatabaseLocker
Represents an exclusive lock on a database to avoid multiple brokers running
against the same logical database.
- Version:
- $Revision: $
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_LOCK_ACQUIRE_SLEEP_INTERVAL
public static final long DEFAULT_LOCK_ACQUIRE_SLEEP_INTERVAL
- See Also:
- Constant Field Values
DefaultDatabaseLocker
public DefaultDatabaseLocker(JDBCPersistenceAdapter persistenceAdapter)
throws IOException
- Throws:
IOException
DefaultDatabaseLocker
public DefaultDatabaseLocker(DataSource dataSource,
Statements statements)
start
public void start()
throws Exception
- Specified by:
start in interface Service
- Throws:
Exception
stop
public void stop()
throws Exception
- Specified by:
stop in interface Service
- Throws:
Exception
keepAlive
public boolean keepAlive()
- Description copied from interface:
DatabaseLocker
- Used by a timer to keep alive the lock.
If the method returns false the broker should be terminated
- Specified by:
keepAlive in interface DatabaseLocker
getLockAcquireSleepInterval
public long getLockAcquireSleepInterval()
setLockAcquireSleepInterval
public void setLockAcquireSleepInterval(long lockAcquireSleepInterval)
getExceptionHandler
public Handler getExceptionHandler()
setExceptionHandler
public void setExceptionHandler(Handler exceptionHandler)
Copyright © 2008. All Rights Reserved.