Class SoftReference<T,A>

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

public class SoftReference<T,A> extends SoftReference<T> implements Reference<T,A>
Deprecated.
Use SoftReference instead.
A reapable soft reference with an attachment. If a Reaper is given, then it will be used to asynchronously clean up the referent.
Author:
David M. Lloyd
See Also:
  • Constructor Details

    • SoftReference

      public SoftReference(T referent)
      Deprecated.
      Construct a new instance.
      Parameters:
      referent - the referent
    • SoftReference

      public SoftReference(T referent, A attachment)
      Deprecated.
      Construct a new instance.
      Parameters:
      referent - the referent
      attachment - the attachment
    • SoftReference

      public SoftReference(T referent, A attachment, ReferenceQueue<? super T> q)
      Deprecated.
      Construct a new instance with an explicit reference queue.
      Parameters:
      referent - the referent
      attachment - the attachment
      q - the reference queue to use
    • SoftReference

      public SoftReference(T referent, A attachment, Reaper<T,A> reaper)
      Deprecated.
      Construct a new instance with a reaper.
      Parameters:
      referent - the referent
      attachment - the attachment
      reaper - the reaper to use
  • Method Details

    • getReaper

      public Reaper<T,A> getReaper()
      Deprecated.
    • getAttachment

      public A getAttachment()
      Deprecated.
      Description copied from interface: Reference
      Get the attachment, if any.
      Specified by:
      getAttachment in interface Reference<T,A>
      Returns:
      the attachment
    • getType

      public Reference.Type getType()
      Deprecated.
      Description copied from interface: Reference
      Get the type of the reference.
      Specified by:
      getType in interface Reference<T,A>
      Returns:
      the type
    • toString

      public String toString()
      Deprecated.
      Overrides:
      toString in class Object