Class SoftResourceReference

  • All Implemented Interfaces:
    IResourceReference

    public class SoftResourceReference
    extends java.lang.ref.SoftReference
    implements IResourceReference
    A generic reference to some trackable resource. The resource finalization is managed using a SoftReference to the container. When the container is garbage collected, the reference is forwarded to the ResourceTracker that created it for disposal.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dispose()  
      java.lang.Object getResource()
      The resource tracked.
      • Methods inherited from class java.lang.ref.SoftReference

        get
      • Methods inherited from class java.lang.ref.Reference

        clear, clone, enqueue, isEnqueued, reachabilityFence
      • Methods inherited from class java.lang.Object

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

      • SoftResourceReference

        public SoftResourceReference​(java.lang.Object container,
                                     java.lang.Object resource,
                                     ResourceTracker tracker)