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, queryTimeout
DEFAULT_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() |
void |
setExceptionHandler(Handler exceptionHandler) |
void |
setLockAcquireSleepInterval(long lockAcquireSleepInterval) |
close, close, configure, getConnection, getQueryTimeout, getStatements, preStart, setCreateTablesOnStartup, setDataSource, setQueryTimeout, setQueryTimeout, setStatements
setFailIfLocked, setLockable, setName
addServiceListener, dispose, isStarted, isStopped, isStopping, postStop, removeServiceListener, start, stop
protected 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 ServiceSupport
Exception
public void doStop(ServiceStopper stopper) throws Exception
doStop
in class ServiceSupport
Exception
public boolean keepAlive() throws IOException
keepAlive
in interface Locker
keepAlive
in class AbstractLocker
IOException
public long getLockAcquireSleepInterval()
getLockAcquireSleepInterval
in class AbstractLocker
public void setLockAcquireSleepInterval(long lockAcquireSleepInterval)
setLockAcquireSleepInterval
in interface Locker
setLockAcquireSleepInterval
in class AbstractLocker
public Handler getExceptionHandler()
public void setExceptionHandler(Handler exceptionHandler)
Copyright © 2005–2018 FuseSource, Corp.. All rights reserved.