public static ScheduledExecutorService CreateLogSyncer() { ScheduledExecutorService scheduler = Executors.NewSingleThreadScheduledExecutor(new _ThreadFactory_331()); ShutdownHookManager.Get().AddShutdownHook(new _Runnable_340(scheduler), 50); scheduler.ScheduleWithFixedDelay(new _Runnable_347(), 0L, 5L, TimeUnit.Seconds); return(scheduler); }
/// <exception cref="System.Exception"/> protected override void ServiceStart() { if (planFollower != null) { scheduledExecutorService = new ScheduledThreadPoolExecutor(1); scheduledExecutorService.ScheduleWithFixedDelay(planFollower, 0L, planStepSize, TimeUnit .Milliseconds); } base.ServiceStart(); }
public virtual void Schedule <_T0>(Callable <_T0> callable, long delay, long interval , TimeUnit unit) { Check.NotNull(callable, "callable"); if (!scheduler.IsShutdown()) { Log.Debug("Scheduling callable [{}], interval [{}] seconds, delay [{}] in [{}]", new object[] { callable, delay, interval, unit }); Runnable r = new _Runnable_98(this, callable); scheduler.ScheduleWithFixedDelay(r, delay, interval, unit); } else { throw new InvalidOperationException(MessageFormat.Format("Scheduler shutting down, ignoring scheduling of [{}]" , callable)); } }
//JAVA TO C# CONVERTER TODO TASK: Java wildcard generics are not converted to .NET: //ORIGINAL LINE: public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) public virtual ScheduledFuture <?> ScheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) { return(e.ScheduleWithFixedDelay(command, initialDelay, delay, unit)); }