private JdbcNodeManager(Supplier<? extends SharedStateManager> sharedStateManagerFactory, long lockRenewPeriodMillis, long lockAcquisitionTimeoutMillis, ScheduledExecutorService scheduledExecutorService, ExecutorFactory executorFactory, IOCriticalErrorListener ioCriticalErrorListener) { super(false, null); this.lockAcquisitionTimeoutMillis = lockAcquisitionTimeoutMillis; this.pauser = LeaseLock.Pauser.sleep(Math.min(lockRenewPeriodMillis, MAX_PAUSE_MILLIS), TimeUnit.MILLISECONDS); this.sharedStateManagerFactory = sharedStateManagerFactory; this.scheduledLiveLockFactory = () -> ScheduledLeaseLock.of( scheduledExecutorService, executorFactory != null ? executorFactory.getExecutor() : null, "live", this.sharedStateManager.liveLock(), lockRenewPeriodMillis, ioCriticalErrorListener); this.scheduledBackupLockFactory = () -> ScheduledLeaseLock.of( scheduledExecutorService, executorFactory != null ? executorFactory.getExecutor() : null, "backup", this.sharedStateManager.backupLock(), lockRenewPeriodMillis, ioCriticalErrorListener); this.ioCriticalErrorListener = ioCriticalErrorListener; this.sharedStateManager = null; this.scheduledLiveLock = null; this.scheduledBackupLock = null; }