Package io.smallrye.common.ref
Class PhantomReference<T,A>
java.lang.Object
java.lang.ref.Reference<T>
java.lang.ref.PhantomReference<T>
io.smallrye.common.ref.PhantomReference<T,A>
- Type Parameters:
T- the reference value typeA- the attachment type
- All Implemented Interfaces:
Reference<T,A>
- Direct Known Subclasses:
CleanerReference
A reapable phantom reference with an attachment. If a
Reaper is given, then it will be used to asynchronously
clean up the referent.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.smallrye.common.ref.Reference
Reference.Type -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new instance with a reaper.PhantomReference(T referent, A attachment, ReferenceQueue<? super T> q) Construct a new instance with an explicit reference queue. -
Method Summary
Methods inherited from class java.lang.ref.PhantomReference
getMethods inherited from class java.lang.ref.Reference
clear, clone, enqueue, isEnqueued, reachabilityFence, refersTo
-
Constructor Details
-
PhantomReference
Construct a new instance with an explicit reference queue.- Parameters:
referent- the referentattachment- the attachmentq- the reference queue to use
-
PhantomReference
Construct a new instance with a reaper.- Parameters:
referent- the referentattachment- the attachmentreaper- the reaper to use
-
-
Method Details