Package org.jboss.modules.ref
Class PhantomReference<T,A>
- java.lang.Object
 - 
- java.lang.ref.Reference<T>
 - 
- java.lang.ref.PhantomReference<T>
 - 
- org.jboss.modules.ref.PhantomReference<T,A>
 
 
 
 
- 
- Type Parameters:
 T- the reference value typeA- the attachment type
- All Implemented Interfaces:
 Reference<T,A>
public class PhantomReference<T,A> extends java.lang.ref.PhantomReference<T> implements Reference<T,A>
A reapable phantom reference with an attachment. If aReaperis given, then it will be used to asynchronously clean up the referent.- Author:
 - David M. Lloyd
 - See Also:
 PhantomReference
 
- 
- 
Nested Class Summary
- 
Nested classes/interfaces inherited from interface org.jboss.modules.ref.Reference
Reference.Type 
 - 
 
- 
Constructor Summary
Constructors Constructor Description PhantomReference(T referent, A attachment, java.lang.ref.ReferenceQueue<? super T> q)PhantomReference(T referent, A attachment, Reaper<T,A> reaper) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AgetAttachment()Get the attachment, if any.Reaper<T,A>getReaper()Reference.TypegetType()Get the type of the reference.java.lang.StringtoString()- 
Methods inherited from class java.lang.ref.Reference
clear, clone, enqueue, isEnqueued, reachabilityFence 
 - 
 
 - 
 
- 
- 
Method Detail
- 
getAttachment
public A getAttachment()
Description copied from interface:ReferenceGet the attachment, if any.- Specified by:
 getAttachmentin interfaceReference<T,A>- Returns:
 - the attachment
 
 
- 
getType
public Reference.Type getType()
Description copied from interface:ReferenceGet the type of the reference. 
- 
toString
public java.lang.String toString()
- Overrides:
 toStringin classjava.lang.Object
 
 - 
 
 -