AsyncReadBinding
, ReferenceCounted
public class AsyncSingleConnectionReadBinding extends Object implements AsyncReadBinding
Constructor | Description |
---|---|
AsyncSingleConnectionReadBindingโ(ReadPreference readPreference,
ServerDescription serverDescription,
AsyncConnection connection) |
Construct an instance.
|
Modifier and Type | Method | Description |
---|---|---|
int |
getCountโ() |
Gets the current reference count, which starts at 0.
|
void |
getReadConnectionSourceโ(SingleResultCallback<AsyncConnectionSource> callback) |
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.
|
SessionContext |
getSessionContextโ() |
Gets the session context for this binding.
|
void |
releaseโ() |
Release a reference to this object.
|
AsyncReadBinding |
retainโ() |
Retain an additional reference to this object.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCount
public AsyncSingleConnectionReadBindingโ(ReadPreference readPreference, ServerDescription serverDescription, AsyncConnection connection)
readPreference
- the read preferenced of this bindingserverDescription
- the description of the serverconnection
- the connection to bind to.public ReadPreference getReadPreferenceโ()
AsyncReadBinding
getReadPreference
in interface AsyncReadBinding
public SessionContext getSessionContextโ()
AsyncReadBinding
getSessionContext
in interface AsyncReadBinding
public void getReadConnectionSourceโ(SingleResultCallback<AsyncConnectionSource> callback)
AsyncReadBinding
getReadConnectionSource
in interface AsyncReadBinding
callback
- the to be passed the connection sourcepublic AsyncReadBinding retainโ()
ReferenceCounted
retain
in interface AsyncReadBinding
retain
in interface ReferenceCounted
public void releaseโ()
ReferenceCounted
release
in interface ReferenceCounted
public int getCountโ()
ReferenceCounted
getCount
in interface ReferenceCounted