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>
A reusable task that performs the maintenance work; used to avoid wrapping by ForkJoinPool.
-
Field Summary
Fields -
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, compareAndSetForkJoinTaskTag, 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, reinitialize, setForkJoinTaskTag, tryUnfork
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
Constructor Details
-
PerformCleanupTask
PerformCleanupTask()
-
-
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)
-