Class BoundedLocalCache.PerformCleanupTask
java.lang.Object
java.util.concurrent.ForkJoinTask<Void>
com.github.benmanes.caffeine.cache.BoundedLocalCache.PerformCleanupTask
- All Implemented Interfaces:
Serializable, Runnable, Future<Void>
- Enclosing class:
BoundedLocalCache<K,V>
static final class BoundedLocalCache.PerformCleanupTask
extends ForkJoinTask<Void>
implements Runnable
A reusable task that performs the maintenance work; used to avoid wrapping by ForkJoinPool.
-
Nested Class Summary
Nested classes/interfaces inherited from interface Future
Future.State -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final WeakReference<BoundedLocalCache<?, ?>> private static final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancancel(boolean mayInterruptIfRunning) voidvoidbooleanexec()This method cannot be ignored due to being final, so a hostile user supplied Executor could forcibly complete the task and halt future executions.voidrun()voidsetRawResult(Void v) Methods inherited from class ForkJoinTask
adapt, adapt, adapt, adaptInterruptible, adaptInterruptible, adaptInterruptible, compareAndSetForkJoinTaskTag, exceptionNow, fork, get, get, getException, getForkJoinTaskTag, getPool, getQueuedTaskCount, getSurplusQueuedTaskCount, helpQuiesce, inForkJoinPool, invoke, invokeAll, invokeAll, invokeAll, isCancelled, isCompletedAbnormally, isCompletedNormally, isDone, join, peekNextLocalTask, pollNextLocalTask, pollSubmission, pollTask, quietlyComplete, quietlyInvoke, quietlyJoin, quietlyJoin, quietlyJoinUninterruptibly, reinitialize, resultNow, setForkJoinTaskTag, state, tryUnfork
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
reference
-
-
Constructor Details
-
PerformCleanupTask
PerformCleanupTask(BoundedLocalCache<?, ?> cache)
-
-
Method Details
-
exec
public boolean exec()- Specified by:
execin classForkJoinTask<Void>
-
run
-
getRawResult
This method cannot be ignored due to being final, so a hostile user supplied Executor could forcibly complete the task and halt future executions. There are easier ways to intentionally harm a system, so this is assumed to not happen in practice.- Specified by:
getRawResultin classForkJoinTask<Void>
-
setRawResult
- Specified by:
setRawResultin classForkJoinTask<Void>
-
complete
- Overrides:
completein classForkJoinTask<Void>
-
completeExceptionally
- Overrides:
completeExceptionallyin classForkJoinTask<Void>
-
cancel
-