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 java.util.concurrent.Future
Future.State
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final WeakReference
<BoundedLocalCache<?, ?>> private static final long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
cancel
(boolean mayInterruptIfRunning) void
void
boolean
exec()
This method cannot be ignored due to being final, so a hostile user supplied Executor could forcibly complete the task and halt future executions.void
run()
void
setRawResult
(Void v) Methods inherited from class java.util.concurrent.ForkJoinTask
adapt, adapt, adapt, 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:
exec
in classForkJoinTask<Void>
-
run
public 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:
getRawResult
in classForkJoinTask<Void>
-
setRawResult
- Specified by:
setRawResult
in classForkJoinTask<Void>
-
complete
- Overrides:
complete
in classForkJoinTask<Void>
-
completeExceptionally
- Overrides:
completeExceptionally
in classForkJoinTask<Void>
-
cancel
public boolean cancel(boolean mayInterruptIfRunning)
-