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

@Deprecated(forRemoval=true) public class PhantomReference<T,A> extends PhantomReference<T> implements Reference<T,A>
Deprecated, for removal: This API element is subject to removal in a future version.
Use PhantomReference instead.
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:
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.wildfly.common.ref.Reference

    Reference.Type
  • Constructor Summary

    Constructors
    Constructor
    Description
    PhantomReference(T referent, A attachment, ReferenceQueue<? super T> q)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Construct a new instance with an explicit reference queue.
    PhantomReference(T referent, A attachment, Reaper<T,A> reaper)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Construct a new instance with a reaper.
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the attachment, if any.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the type of the reference.
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class java.lang.ref.PhantomReference

    get

    Methods inherited from class java.lang.ref.Reference

    clear, clone, enqueue, isEnqueued, reachabilityFence, refersTo

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.wildfly.common.ref.Reference

    clear, get
  • Constructor Details

    • PhantomReference

      public PhantomReference(T referent, A attachment, ReferenceQueue<? super T> q)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Construct a new instance with a reaper.
      Parameters:
      referent - the referent
      attachment - the attachment
      reaper - the reaper to use
  • Method Details

    • getAttachment

      public A getAttachment()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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, for removal: This API element is subject to removal in a future version.
      Description copied from interface: Reference
      Get the type of the reference.
      Specified by:
      getType in interface Reference<T,A>
      Returns:
      the type
    • getReaper

      public Reaper<T,A> getReaper()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • toString

      public String toString()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      toString in class Object