Class BoundedLocalCache.PerformCleanupTask

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Runnable, java.util.concurrent.Future<java.lang.Void>
    Enclosing class:
    BoundedLocalCache<K,​V>

    final class BoundedLocalCache.PerformCleanupTask
    extends java.util.concurrent.ForkJoinTask<java.lang.Void>
    implements java.lang.Runnable
    A reusable task that performs the maintenance work; used to avoid wrapping by ForkJoinPool.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static long serialVersionUID  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean cancel​(boolean mayInterruptIfRunning)  
      void complete​(java.lang.Void value)  
      void completeExceptionally​(java.lang.Throwable ex)  
      boolean exec()  
      java.lang.Void 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.
      void run()  
      void setRawResult​(java.lang.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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PerformCleanupTask

        PerformCleanupTask()
    • Method Detail

      • exec

        public boolean exec()
        Specified by:
        exec in class java.util.concurrent.ForkJoinTask<java.lang.Void>
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
      • getRawResult

        public java.lang.Void 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 class java.util.concurrent.ForkJoinTask<java.lang.Void>
      • setRawResult

        public void setRawResult​(java.lang.Void v)
        Specified by:
        setRawResult in class java.util.concurrent.ForkJoinTask<java.lang.Void>
      • complete

        public void complete​(java.lang.Void value)
        Overrides:
        complete in class java.util.concurrent.ForkJoinTask<java.lang.Void>
      • completeExceptionally

        public void completeExceptionally​(java.lang.Throwable ex)
        Overrides:
        completeExceptionally in class java.util.concurrent.ForkJoinTask<java.lang.Void>
      • cancel

        public boolean cancel​(boolean mayInterruptIfRunning)
        Specified by:
        cancel in interface java.util.concurrent.Future<java.lang.Void>
        Overrides:
        cancel in class java.util.concurrent.ForkJoinTask<java.lang.Void>