Class LeaseDatabaseLocker

  • All Implemented Interfaces:
    Locker, Service

    public class LeaseDatabaseLocker
    extends AbstractJDBCLocker
    Represents an exclusive lease on a database to avoid multiple brokers running against the same logical database.
    • Field Detail

      • maxAllowableDiffFromDBTime

        protected int maxAllowableDiffFromDBTime
      • diffFromCurrentTime

        protected long diffFromCurrentTime
      • leaseHolderId

        protected String leaseHolderId
      • handleStartException

        protected boolean handleStartException
    • Constructor Detail

      • LeaseDatabaseLocker

        public LeaseDatabaseLocker()
    • Method Detail

      • keepAlive

        public boolean keepAlive()
                          throws IOException
        Description copied from interface: Locker
        Used by a timer to keep alive the lock. If the method returns false the broker should be terminated if an exception is thrown, the lock state cannot be determined
        Specified by:
        keepAlive in interface Locker
        Overrides:
        keepAlive in class AbstractLocker
        Throws:
        IOException
      • getLeaseHolderId

        public String getLeaseHolderId()
      • setLeaseHolderId

        public void setLeaseHolderId​(String leaseHolderId)
      • getMaxAllowableDiffFromDBTime

        public int getMaxAllowableDiffFromDBTime()
      • setMaxAllowableDiffFromDBTime

        public void setMaxAllowableDiffFromDBTime​(int maxAllowableDiffFromDBTime)
      • isHandleStartException

        public boolean isHandleStartException()
      • setHandleStartException

        public void setHandleStartException​(boolean handleStartException)