Package org.wildfly.common.ref
Class WeakReference<T,A>
java.lang.Object
java.lang.ref.Reference<T>
java.lang.ref.WeakReference<T>
org.wildfly.common.ref.WeakReference<T,A>
- Type Parameters:
T- the reference value typeA- the attachment type
- All Implemented Interfaces:
Reference<T,A>
@Deprecated(forRemoval=true)
public class WeakReference<T,A>
extends WeakReference<T>
implements Reference<T,A>
Deprecated, for removal: This API element is subject to removal in a future version.
A reapable weak 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
ConstructorsConstructorDescriptionWeakReference(T referent) Deprecated, for removal: This API element is subject to removal in a future version.Construct a new instance.WeakReference(T referent, A attachment) Deprecated, for removal: This API element is subject to removal in a future version.Construct a new instance.WeakReference(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.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 TypeMethodDescriptionDeprecated, 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.getType()Deprecated, for removal: This API element is subject to removal in a future version.Get the type of the reference.toString()Deprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class java.lang.ref.Reference
clear, clone, enqueue, get, isEnqueued, reachabilityFence, refersTo
-
Constructor Details
-
WeakReference
Deprecated, for removal: This API element is subject to removal in a future version.Construct a new instance.- Parameters:
referent- the referent
-
WeakReference
Deprecated, for removal: This API element is subject to removal in a future version.Construct a new instance.- Parameters:
referent- the referentattachment- the attachment
-
WeakReference
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 referentattachment- the attachmentq- the reference queue to use
-
WeakReference
Deprecated, for removal: This API element is subject to removal in a future version.Construct a new instance with a reaper.- Parameters:
referent- the referentattachment- the attachmentreaper- the reaper to use
-
-
Method Details
-
getAttachment
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:ReferenceGet the attachment, if any.- Specified by:
getAttachmentin interfaceReference<T,A> - Returns:
- the attachment
-
getType
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:ReferenceGet the type of the reference. -
getReaper
Deprecated, for removal: This API element is subject to removal in a future version. -
toString
Deprecated, for removal: This API element is subject to removal in a future version.
-
WeakReferenceinstead.