Class LocalScheduler<T>

java.lang.Object
org.wildfly.clustering.server.local.scheduler.LocalScheduler<T>
Type Parameters:
T - the scheduled entry identifier type
All Implemented Interfaces:
AutoCloseable, Runnable, Scheduler<T,Instant>

public class LocalScheduler<T> extends Object implements Scheduler<T,Instant>, Runnable
Scheduler that uses a single scheduled task in concert with a ScheduledEntries.
Author:
Paul Ferraro
  • Constructor Details

  • Method Details

    • schedule

      public void schedule(T id, Instant instant)
      Description copied from interface: Scheduler
      Schedules a task for the object with the specified identifier, using the specified metaData
      Specified by:
      schedule in interface Scheduler<T,Instant>
      Parameters:
      id - an object identifier
      instant - the object meta-data
    • cancel

      public void cancel(T id)
      Description copied from interface: Scheduler
      Cancels a previously scheduled task for the object with the specified identifier.
      Specified by:
      cancel in interface Scheduler<T,Instant>
      Parameters:
      id - an object identifier
    • contains

      public boolean contains(T id)
      Description copied from interface: Scheduler
      Indicates whether the entry with the specified identifier is scheduled.
      Specified by:
      contains in interface Scheduler<T,Instant>
      Parameters:
      id - an object identifier
      Returns:
      true, if the specified entry is scheduled, false otherwise.
    • stream

      public Stream<T> stream()
      Description copied from interface: Scheduler
      Returns a stream of scheduled item identifiers.
      Specified by:
      stream in interface Scheduler<T,Instant>
      Returns:
      a stream of scheduled item identifiers.
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Scheduler<T,Instant>
    • run

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

      public String toString()
      Overrides:
      toString in class Object