panda.task.ReschedulingRunnable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of panda-core Show documentation
Show all versions of panda-core Show documentation
Panda Core is the core module of Panda Framework, it contains commonly used utility classes similar to apache-commons.
package panda.task;
import panda.lang.ErrorHandler;
import java.util.Date;
import java.util.concurrent.Delayed;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
/**
* Internal adapter that reschedules an underlying {@link Runnable} according
* to the next execution time suggested by a given {@link Trigger}.
*
* Necessary because a native {@link ScheduledExecutorService} supports
* delay-driven execution only. The flexibility of the {@link Trigger} interface
* will be translated onto a delay for the next execution time (repeatedly).
*
*/
class ReschedulingRunnable extends DelegatingErrorHandlingRunnable implements ScheduledFuture