Class MCRDelayedRunnable

java.lang.Object
org.mycore.util.concurrent.MCRDelayedRunnable
All Implemented Interfaces:
Comparable<Delayed>, Runnable, Delayed, MCRDecorator<Runnable>

public class MCRDelayedRunnable extends Object implements Delayed, Runnable, MCRDecorator<Runnable>
Encapsulates a Runnable with in a object that can be fed into a DelayQueue Note: This class has a natural ordering that is inconsistent with equals. Note: Two objects of this class are equal, if their ids are equal (other properties are ignored).
Author:
Robert Stephan
  • Field Details

    • runnable

      protected Runnable runnable
  • Constructor Details

    • MCRDelayedRunnable

      public MCRDelayedRunnable(String id, long delayInMs, Runnable runnable)
      Creates a new MCRDelayedRunnable encapsulating a Runnable for delayed execution.
      Parameters:
      id - , - the id of the runnable (used for equals-check)
      delayInMs - - the time in (ms) the task should be delayed
      runnable - the runnable to execute within a session and transaction
  • Method Details