Class DebugReferencesByContextMap

  • All Implemented Interfaces:
    References

    public class DebugReferencesByContextMap
    extends java.lang.Object
    implements References
    Does reference counting by putting a unique key together with optional context in map Used if system property jdisc.debug.resources=simple/true
    Author:
    baldersheim
    • Constructor Detail

      • DebugReferencesByContextMap

        public DebugReferencesByContextMap​(DestructableResource resource,
                                           java.lang.Object context)
    • Method Detail

      • release

        public void release()
        Description copied from interface: References
        Release the initial reference
        Specified by:
        release in interface References
      • referenceCount

        public int referenceCount()
        Description copied from interface: References
        Returns number of held references
        Specified by:
        referenceCount in interface References
      • refer

        public ResourceReference refer​(java.lang.Object context)
        Description copied from interface: References
        Adds a reference and return an objects that when closed will return the reference. Supply a context that can provide link to the one holding the link. Useful for debugging
        Specified by:
        refer in interface References