public class SingleConnectionReadBinding extends Object implements ReadBinding
| Constructor and Description |
|---|
SingleConnectionReadBinding(ReadPreference readPreference,
ServerDescription serverDescription,
Connection connection)
Construct an instance.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getCount()
Gets the current reference count, which starts at 0.
|
ConnectionSource |
getReadConnectionSource()
Returns a connection source to a server that satisfies the specified read preference.
|
ReadPreference |
getReadPreference()
The read preference that all connection sources returned by this instance will satisfy.
|
void |
release()
Release a reference to this object.
|
ReadBinding |
retain()
Retain an additional reference to this object.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCountpublic SingleConnectionReadBinding(ReadPreference readPreference, ServerDescription serverDescription, Connection connection)
readPreference - the read preference of this bindingserverDescription - the description of the serverconnection - the connection to bind to.public ReadPreference getReadPreference()
ReadBindinggetReadPreference in interface ReadBindingpublic ConnectionSource getReadConnectionSource()
ReadBindinggetReadConnectionSource in interface ReadBindingpublic ReadBinding retain()
ReferenceCountedretain in interface ReadBindingretain in interface ReferenceCountedpublic void release()
ReferenceCountedrelease in interface ReferenceCountedpublic int getCount()
ReferenceCountedgetCount in interface ReferenceCounted