Package com.mongodb.binding
Interface ReferenceCounted
-
- All Known Subinterfaces:
AsyncConnection
,AsyncConnectionSource
,AsyncReadBinding
,AsyncReadWriteBinding
,AsyncWriteBinding
,Connection
,ConnectionSource
,ReadBinding
,ReadWriteBinding
,WriteBinding
- All Known Implementing Classes:
com.mongodb.internal.binding.AbstractReferenceCounted
,AsyncClusterBinding
,AsyncSingleConnectionReadBinding
,AsyncSingleServerBinding
,ClusterBinding
,DefaultServerConnection
,SingleConnectionReadBinding
,SingleServerBinding
@Deprecated public interface ReferenceCounted
Deprecated.An interface for reference-counted objects.- Since:
- 3.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description int
getCount()
Deprecated.Gets the current reference count, which starts at 0.void
release()
Deprecated.Release a reference to this object.ReferenceCounted
retain()
Deprecated.Retain an additional reference to this object.
-
-
-
Method Detail
-
getCount
int getCount()
Deprecated.Gets the current reference count, which starts at 0.- Returns:
- the current count, which must be greater than or equal to 0
-
retain
ReferenceCounted retain()
Deprecated.Retain an additional reference to this object. All retained references must be released, or there will be a leak.- Returns:
- this
-
release
void release()
Deprecated.Release a reference to this object.- Throws:
java.lang.IllegalStateException
- if the reference count is already 0
-
-