public class DefaultDatabaseLocker extends AbstractJDBCLocker
| Modifier and Type | Field and Description |
|---|---|
protected java.sql.Connection |
connection |
protected Handler<java.lang.Exception> |
exceptionHandler |
protected java.sql.PreparedStatement |
lockCreateStatement |
protected java.sql.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 java.sql.PreparedStatement lockCreateStatement
protected volatile java.sql.PreparedStatement lockUpdateStatement
protected volatile java.sql.Connection connection
protected Handler<java.lang.Exception> exceptionHandler
public void doStart()
throws java.lang.Exception
doStart in class ServiceSupportjava.lang.Exceptionpublic void doStop(ServiceStopper stopper) throws java.lang.Exception
doStop in class ServiceSupportjava.lang.Exceptionpublic boolean keepAlive()
throws java.io.IOException
LockerkeepAlive in interface LockerkeepAlive in class AbstractLockerjava.io.IOExceptionpublic 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-2014 Red Hat, Inc.. All Rights Reserved.