Package com.yahoo.jdisc.refcount
Class ReferencesByCount
- java.lang.Object
-
- com.yahoo.jdisc.refcount.ReferencesByCount
-
- All Implemented Interfaces:
References
public class ReferencesByCount extends java.lang.Object implements References
Does reference counting by using atomic counting of references Default in production- Author:
- baldersheim
-
-
Constructor Summary
Constructors Constructor Description ReferencesByCount(DestructableResource resource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
currentState()
ResourceReference
refer(java.lang.Object context)
Adds a reference and return an objects that when closed will return the reference.int
referenceCount()
Returns number of held referencesvoid
release()
Release the initial reference
-
-
-
Constructor Detail
-
ReferencesByCount
public ReferencesByCount(DestructableResource resource)
-
-
Method Detail
-
release
public void release()
Description copied from interface:References
Release the initial reference- Specified by:
release
in interfaceReferences
-
referenceCount
public int referenceCount()
Description copied from interface:References
Returns number of held references- Specified by:
referenceCount
in interfaceReferences
-
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 interfaceReferences
-
currentState
public java.lang.String currentState()
- Specified by:
currentState
in interfaceReferences
-
-