Class EvictionTimer.WeakRunner<R extends java.lang.Runnable>

  • Type Parameters:
    R - The kind of Runnable.
    All Implemented Interfaces:
    java.lang.Runnable
    Enclosing class:
    EvictionTimer

    private static final class EvictionTimer.WeakRunner<R extends java.lang.Runnable>
    extends java.lang.Object
    implements java.lang.Runnable
    Runnable that runs the referent of a weak reference. When the referent is no no longer reachable, run is no-op.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.ref.WeakReference<R> ref  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private WeakRunner​(java.lang.ref.WeakReference<R> ref)
      Constructs a new instance to track the given reference.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void run()  
      • Methods inherited from class java.lang.Object

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

      • ref

        private final java.lang.ref.WeakReference<R extends java.lang.Runnable> ref
    • Constructor Detail

      • WeakRunner

        private WeakRunner​(java.lang.ref.WeakReference<R> ref)
        Constructs a new instance to track the given reference.
        Parameters:
        ref - the reference to track.
    • Method Detail

      • run

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