Class ConcurrentReferenceHashMap.ReferenceManager

java.lang.Object
nl.basjes.parse.useragent.utils.springframework.util.ConcurrentReferenceHashMap.ReferenceManager
Enclosing class:
ConcurrentReferenceHashMap<K,V>

protected class ConcurrentReferenceHashMap.ReferenceManager extends Object
Strategy class used to manage {link Reference References}. This class can be overridden if alternative reference types need to be supported.
Since:
3.2
Author:
Phillip Webb, Juergen Hoeller
  • Constructor Details

    • ReferenceManager

      protected ReferenceManager()
  • Method Details

    • createReference

      Factory method used to create a new {link Reference}.
      Parameters:
      entry - the entry contained in the reference
      hash - the hash
      next - the next reference in the chain, or null if none
      Returns:
      a new {link Reference}
    • pollForPurge

      @Nullable public 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. This method must be thread safe and ideally should not block when returning null. References should be returned once and only once.
      Returns:
      a reference to purge or null