public override void Start() { if (_checkIntervalMillis > 0) { _monitorJobHandle = _scheduler.scheduleRecurring(Group.TRANSACTION_TIMEOUT_MONITOR, _kernelTransactionMonitor, _checkIntervalMillis, TimeUnit.MILLISECONDS); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void startJobTransactionMonitor() internal virtual void StartJobTransactionMonitor() { JobHandle jobHandle = Mockito.mock(typeof(JobHandle)); when(_jobScheduler.scheduleRecurring(eq(Group.TRANSACTION_TIMEOUT_MONITOR), eq(_transactionMonitor), anyLong(), any(typeof(TimeUnit)))).thenReturn(jobHandle); KernelTransactionMonitorScheduler monitorScheduler = new KernelTransactionMonitorScheduler(_transactionMonitor, _jobScheduler, 7); monitorScheduler.Start(); verify(_jobScheduler).scheduleRecurring(Group.TRANSACTION_TIMEOUT_MONITOR, _transactionMonitor, 7, TimeUnit.MILLISECONDS); monitorScheduler.Stop(); verify(jobHandle).cancel(true); }
public override void Init() { if (_pullIntervalMillis > 0) { _intervalJobHandle = _scheduler.scheduleRecurring(Group.PULL_UPDATES, () => { try { _updatePuller.pullUpdates(); } catch (InterruptedException e) { _log.error("Pull updates failed", e); } }, _pullIntervalMillis, _pullIntervalMillis, TimeUnit.MILLISECONDS); } }
public virtual Optional <JobHandle> ScheduleDownload(CatchupAddressProvider addressProvider) { lock (this) { if (_stopped) { return(null); } if (_currentJob == null || _currentJob.hasCompleted()) { _currentJob = new PersistentSnapshotDownloader(addressProvider, _applicationProcess, _downloader, _log, _downloaderPauseStrategy, _dbHealth, _monitors); _jobHandle = _jobScheduler.schedule(Group.DOWNLOAD_SNAPSHOT, _currentJob); return(_jobHandle); } return(_jobHandle); } }
public override void Start() { _jobHandle = _scheduler.scheduleRecurring(Group.STORAGE_MAINTENANCE, this.maintenance, 1, TimeUnit.SECONDS); }