Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 /// <exception cref="System.Exception"/>
 protected override void ServiceStart()
 {
     if (planFollower != null)
     {
         scheduledExecutorService = new ScheduledThreadPoolExecutor(1);
         scheduledExecutorService.ScheduleWithFixedDelay(planFollower, 0L, planStepSize, TimeUnit
                                                         .Milliseconds);
     }
     base.ServiceStart();
 }
Exemplo n.º 3
0
 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));
     }
 }
Exemplo n.º 4
0
//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));
            }