Class PrimaryOwnerScheduler<I,M>

java.lang.Object
org.wildfly.clustering.server.infinispan.scheduler.PrimaryOwnerScheduler<I,M>
Type Parameters:
I - the identifier type of scheduled entries
M - the meta data type
All Implemented Interfaces:
AutoCloseable, Function<CompletionStage<Collection<I>>,Stream<I>>, Scheduler<I,M>

public class PrimaryOwnerScheduler<I,M> extends Object implements Scheduler<I,M>, Function<CompletionStage<Collection<I>>,Stream<I>>
Scheduler decorator that schedules/cancels a given object on the primary owner.
Author:
Paul Ferraro
  • Constructor Details

  • Method Details

    • schedule

      public void schedule(I id, M metaData)
      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<I,M>
      Parameters:
      id - an object identifier
      metaData - the object meta-data
    • cancel

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

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

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

      public Stream<I> apply(CompletionStage<Collection<I>> stage)
      Specified by:
      apply in interface Function<I,M>
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Scheduler<I,M>