Class SoftReference<T,A>

java.lang.Object
java.lang.ref.Reference<T>
java.lang.ref.SoftReference<T>
org.jboss.modules.ref.SoftReference<T,A>
Type Parameters:
T - the reference value type
A - the attachment type
All Implemented Interfaces:
Reapable<T,A>, Reference<T,A>

public class SoftReference<T,A> extends SoftReference<T> implements Reference<T,A>, Reapable<T,A>
A reapable soft reference with an attachment. If a Reaper is given, then it will be used to asynchronously clean up the referent.
See Also:
  • Field Details

    • attachment

      private final A attachment
    • reaper

      private final Reaper<T,A> reaper
  • Constructor Details

    • SoftReference

      public SoftReference(T referent)
    • SoftReference

      public SoftReference(T referent, A attachment)
    • SoftReference

      public SoftReference(T referent, A attachment, ReferenceQueue<? super T> q)
    • SoftReference

      public SoftReference(T referent, A attachment, Reaper<T,A> reaper)
  • Method Details