public class AsyncSingleConnectionReadBinding extends AbstractReferenceCounted implements AsyncReadBinding
Modifier and Type | Class and Description |
---|---|
private class |
AsyncSingleConnectionReadBinding.AsyncSingleConnectionSource |
Modifier and Type | Field and Description |
---|---|
private AsyncConnection |
connection |
private ReadPreference |
readPreference |
private ServerDescription |
serverDescription |
Constructor and Description |
---|
AsyncSingleConnectionReadBinding(ReadPreference readPreference,
ServerDescription serverDescription,
AsyncConnection connection)
Construct an instance.
|
Modifier and Type | Method and Description |
---|---|
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.
|
getCount
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCount
private final ReadPreference readPreference
private final ServerDescription serverDescription
private final AsyncConnection connection
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
retain
in class AbstractReferenceCounted
public void release()
ReferenceCounted
release
in interface ReferenceCounted
release
in class AbstractReferenceCounted