public class AsyncClusterBinding extends java.lang.Object implements AsyncReadWriteBinding
| 构造器和说明 |
|---|
AsyncClusterBinding(Cluster cluster,
ReadPreference readPreference)
Creates an instance.
|
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
void |
getWriteConnectionSource(SingleResultCallback<AsyncConnectionSource> callback)
Supply a connection source to a server that can be written to
|
void |
release()
Release a reference to this object.
|
AsyncReadWriteBinding |
retain()
Retain an additional reference to this object.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCount, releasepublic AsyncClusterBinding(Cluster cluster, ReadPreference readPreference)
cluster - a non-null Cluster which will be used to select a server to bind toreadPreference - a non-null ReadPreference for read operationspublic AsyncReadWriteBinding retain()
ReferenceCountedretain 在接口中 AsyncReadBindingretain 在接口中 AsyncReadWriteBindingretain 在接口中 AsyncWriteBindingretain 在接口中 ReferenceCountedpublic ReadPreference getReadPreference()
AsyncReadBindinggetReadPreference 在接口中 AsyncReadBindingpublic void getReadConnectionSource(SingleResultCallback<AsyncConnectionSource> callback)
AsyncReadBindinggetReadConnectionSource 在接口中 AsyncReadBindingcallback - the to be passed the connection sourcepublic void getWriteConnectionSource(SingleResultCallback<AsyncConnectionSource> callback)
AsyncWriteBindinggetWriteConnectionSource 在接口中 AsyncWriteBindingcallback - the to be passed the connection sourcepublic int getCount()
ReferenceCountedgetCount 在接口中 ReferenceCountedpublic void release()
ReferenceCountedrelease 在接口中 ReferenceCounted