public class LeaseDatabaseLocker extends AbstractJDBCLocker
| Modifier and Type | Field and Description |
|---|---|
protected long |
diffFromCurrentTime |
protected java.lang.String |
leaseHolderId |
protected int |
maxAllowableDiffFromDBTime |
createTablesOnStartup, dataSource, jdbcAdapter, queryTimeoutDEFAULT_LOCK_ACQUIRE_SLEEP_INTERVAL, failIfLocked, lockable, lockAcquireSleepInterval, name| Constructor and Description |
|---|
LeaseDatabaseLocker() |
| Modifier and Type | Method and Description |
|---|---|
protected long |
determineTimeDifference(java.sql.Connection connection) |
void |
doStart() |
void |
doStop(ServiceStopper stopper) |
java.lang.String |
getLeaseHolderId() |
int |
getMaxAllowableDiffFromDBTime() |
protected long |
initTimeDiff(java.sql.Connection connection) |
boolean |
keepAlive()
Used by a timer to keep alive the lock.
|
void |
setLeaseHolderId(java.lang.String leaseHolderId) |
void |
setMaxAllowableDiffFromDBTime(int maxAllowableDiffFromDBTime) |
java.lang.String |
toString() |
close, close, configure, getConnection, getQueryTimeout, getStatements, preStart, setCreateTablesOnStartup, setDataSource, setQueryTimeout, setQueryTimeout, setStatementsgetLockAcquireSleepInterval, setFailIfLocked, setLockable, setLockAcquireSleepInterval, setNameaddServiceListener, dispose, isStarted, isStopped, isStopping, postStop, removeServiceListener, start, stopprotected int maxAllowableDiffFromDBTime
protected long diffFromCurrentTime
protected java.lang.String leaseHolderId
public void doStart()
throws java.lang.Exception
doStart in class ServiceSupportjava.lang.Exceptionprotected long initTimeDiff(java.sql.Connection connection)
throws java.sql.SQLException
java.sql.SQLExceptionprotected long determineTimeDifference(java.sql.Connection connection)
throws java.sql.SQLException
java.sql.SQLExceptionpublic 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 java.lang.String getLeaseHolderId()
public void setLeaseHolderId(java.lang.String leaseHolderId)
public int getMaxAllowableDiffFromDBTime()
public void setMaxAllowableDiffFromDBTime(int maxAllowableDiffFromDBTime)
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2005-2014 Red Hat, Inc.. All Rights Reserved.