Class AbstractScheduledService.CustomScheduler.SupplantableFuture
- java.lang.Object
-
- com.google.common.util.concurrent.AbstractScheduledService.CustomScheduler.SupplantableFuture
-
- All Implemented Interfaces:
AbstractScheduledService.Cancellable
- Enclosing class:
- AbstractScheduledService.CustomScheduler
private static final class AbstractScheduledService.CustomScheduler.SupplantableFuture extends java.lang.Object implements AbstractScheduledService.Cancellable
Contains the most recently submittedFuture
, which may be cancelled or updated, always under a lock.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.Future<java.lang.Void>
currentFuture
private java.util.concurrent.locks.ReentrantLock
lock
-
Constructor Summary
Constructors Constructor Description SupplantableFuture(java.util.concurrent.locks.ReentrantLock lock, java.util.concurrent.Future<java.lang.Void> currentFuture)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancel(boolean mayInterruptIfRunning)
boolean
isCancelled()
-
-
-
Method Detail
-
cancel
public void cancel(boolean mayInterruptIfRunning)
- Specified by:
cancel
in interfaceAbstractScheduledService.Cancellable
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelled
in interfaceAbstractScheduledService.Cancellable
-
-