protected class ConcurrentReferenceHashMap.ReferenceManager
extends java.lang.Object
ConcurrentReferenceHashMap.Reference
s. This class can be overridden if
alternative reference types need to be supported.Modifier and Type | Field and Description |
---|---|
private java.lang.ref.ReferenceQueue<ConcurrentReferenceHashMap.Entry<K,V>> |
queue |
Modifier | Constructor and Description |
---|---|
protected |
ReferenceManager() |
Modifier and Type | Method and Description |
---|---|
ConcurrentReferenceHashMap.Reference<K,V> |
createReference(ConcurrentReferenceHashMap.Entry<K,V> entry,
int hash,
ConcurrentReferenceHashMap.Reference<K,V> next)
Factory method used to create a new
ConcurrentReferenceHashMap.Reference . |
ConcurrentReferenceHashMap.Reference<K,V> |
pollForPurge()
Return any reference that has been garbage collected and can be purged from the
underlying structure or
null if no references need purging. |
private final java.lang.ref.ReferenceQueue<ConcurrentReferenceHashMap.Entry<K,V>> queue
public ConcurrentReferenceHashMap.Reference<K,V> createReference(ConcurrentReferenceHashMap.Entry<K,V> entry, int hash, @Nullable ConcurrentReferenceHashMap.Reference<K,V> next)
ConcurrentReferenceHashMap.Reference
.entry
- the entry contained in the referencehash
- the hashnext
- the next reference in the chain, or null
if noneConcurrentReferenceHashMap.Reference
@Nullable public ConcurrentReferenceHashMap.Reference<K,V> pollForPurge()
null
if no references need purging. This
method must be thread safe and ideally should not block when returning
null
. References should be returned once and only once.null