public class DefaultDatabaseLocker extends AbstractJDBCLocker
| Modifier and Type | Field and Description |
|---|---|
protected Connection |
connection |
protected Handler<Exception> |
exceptionHandler |
protected PreparedStatement |
lockCreateStatement |
protected PreparedStatement |
lockUpdateStatement |
createTablesOnStartup, dataSource, jdbcAdapter, queryTimeoutDEFAULT_LOCK_ACQUIRE_SLEEP_INTERVAL, failIfLocked, lockable, lockAcquireSleepInterval, name| Constructor and Description |
|---|
DefaultDatabaseLocker() |
| Modifier and Type | Method and Description |
|---|---|
void |
doStart() |
void |
doStop(ServiceStopper stopper) |
Handler |
getExceptionHandler() |
long |
getLockAcquireSleepInterval() |
boolean |
keepAlive()
Used by a timer to keep alive the lock.
|
void |
setExceptionHandler(Handler exceptionHandler) |
void |
setLockAcquireSleepInterval(long lockAcquireSleepInterval)
set the delay interval in milliseconds between lock acquire attempts
|
close, close, configure, getConnection, getQueryTimeout, getStatements, preStart, setCreateTablesOnStartup, setDataSource, setQueryTimeout, setQueryTimeout, setStatementssetFailIfLocked, setLockable, setNameaddServiceListener, dispose, isStarted, isStopped, isStopping, postStop, removeServiceListener, start, stopprotected volatile PreparedStatement lockCreateStatement
protected volatile PreparedStatement lockUpdateStatement
protected volatile Connection connection
protected Handler<Exception> exceptionHandler
public DefaultDatabaseLocker()
public void doStart() throws Exception
doStart in class ServiceSupportExceptionpublic void doStop(ServiceStopper stopper) throws Exception
doStop in class ServiceSupportExceptionpublic boolean keepAlive() throws IOException
LockerkeepAlive in interface LockerkeepAlive in class AbstractLockerIOExceptionpublic long getLockAcquireSleepInterval()
getLockAcquireSleepInterval in class AbstractLockerpublic void setLockAcquireSleepInterval(long lockAcquireSleepInterval)
LockersetLockAcquireSleepInterval in interface LockersetLockAcquireSleepInterval in class AbstractLockerlockAcquireSleepInterval - the sleep interval in milisecondspublic Handler getExceptionHandler()
public void setExceptionHandler(Handler exceptionHandler)
Copyright © 2005–2015 FuseSource, Corp.. All rights reserved.