Class LocalSchedulerService<K>

java.lang.Object
org.wildfly.clustering.server.service.SimpleService
org.wildfly.clustering.server.local.scheduler.LocalSchedulerService<K>
Type Parameters:
K - the scheduled entry key type
All Implemented Interfaces:
AutoCloseable, Runnable, org.wildfly.clustering.server.scheduler.Scheduler<K,Instant>, org.wildfly.clustering.server.scheduler.SchedulerService<K,Instant>, org.wildfly.clustering.server.service.Service

public class LocalSchedulerService<K> extends org.wildfly.clustering.server.service.SimpleService implements org.wildfly.clustering.server.scheduler.SchedulerService<K,Instant>, Runnable
Scheduler that uses a single scheduled task in concert with a ScheduledEntries.
Author:
Paul Ferraro
  • Constructor Details

    • LocalSchedulerService

      public LocalSchedulerService(LocalSchedulerService.Configuration<K> configuration)
      Creates a local scheduler using the specified configuration.
      Parameters:
      configuration - the scheduler configuration
  • Method Details

    • schedule

      public void schedule(K key, Instant instant)
      Specified by:
      schedule in interface org.wildfly.clustering.server.scheduler.Scheduler<K,Instant>
    • cancel

      public void cancel(K key)
      Specified by:
      cancel in interface org.wildfly.clustering.server.scheduler.Scheduler<K,Instant>
    • contains

      public boolean contains(K key)
      Specified by:
      contains in interface org.wildfly.clustering.server.scheduler.Scheduler<K,Instant>
    • start

      public void start()
      Specified by:
      start in interface org.wildfly.clustering.server.service.Service
      Overrides:
      start in class org.wildfly.clustering.server.service.SimpleService
    • stop

      public void stop()
      Specified by:
      stop in interface org.wildfly.clustering.server.service.Service
      Overrides:
      stop in class org.wildfly.clustering.server.service.SimpleService
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface org.wildfly.clustering.server.scheduler.SchedulerService<K,Instant>
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • toString

      public String toString()
      Overrides:
      toString in class Object