Class PhantomReference<T,A>

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

public class PhantomReference<T,A> extends PhantomReference<T> implements Reference<T,A>
A reapable phantom 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

    • PhantomReference

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

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