public class LeaseDatabaseLocker extends AbstractJDBCLocker
| Modifier and Type | Field and Description |
|---|---|
protected long |
diffFromCurrentTime |
protected boolean |
handleStartException |
protected 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(Connection connection) |
void |
doStart() |
void |
doStop(ServiceStopper stopper) |
String |
getLeaseHolderId() |
int |
getMaxAllowableDiffFromDBTime() |
protected long |
initTimeDiff(Connection connection) |
boolean |
isHandleStartException() |
boolean |
keepAlive()
Used by a timer to keep alive the lock.
|
void |
setHandleStartException(boolean handleStartException) |
void |
setLeaseHolderId(String leaseHolderId) |
void |
setMaxAllowableDiffFromDBTime(int maxAllowableDiffFromDBTime) |
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 String leaseHolderId
protected boolean handleStartException
public LeaseDatabaseLocker()
public void doStart() throws Exception
doStart in class ServiceSupportExceptionprotected long initTimeDiff(Connection connection) throws SQLException
SQLExceptionprotected long determineTimeDifference(Connection connection) throws SQLException
SQLExceptionpublic void doStop(ServiceStopper stopper) throws Exception
doStop in class ServiceSupportExceptionpublic boolean keepAlive() throws IOException
LockerkeepAlive in interface LockerkeepAlive in class AbstractLockerIOExceptionpublic String getLeaseHolderId()
public void setLeaseHolderId(String leaseHolderId)
public int getMaxAllowableDiffFromDBTime()
public void setMaxAllowableDiffFromDBTime(int maxAllowableDiffFromDBTime)
public boolean isHandleStartException()
public void setHandleStartException(boolean handleStartException)
Copyright © 2005–2016 FuseSource, Corp.. All rights reserved.