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, queryTimeout
DEFAULT_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() |
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, setStatements
getLockAcquireSleepInterval, setFailIfLocked, setLockable, setLockAcquireSleepInterval, setName
addServiceListener, dispose, isStarted, isStopped, isStopping, postStop, removeServiceListener, start, stop
protected int maxAllowableDiffFromDBTime
protected long diffFromCurrentTime
protected String leaseHolderId
protected boolean handleStartException
public LeaseDatabaseLocker()
public void doStart() throws Exception
doStart
in class ServiceSupport
Exception
protected long initTimeDiff(Connection connection) throws SQLException
SQLException
protected long determineTimeDifference(Connection connection) throws SQLException
SQLException
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 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–2019 FuseSource, Corp.. All rights reserved.