public class ClusterBinding extends java.lang.Object implements ReadWriteBinding
| 构造器和说明 |
|---|
ClusterBinding(Cluster cluster,
ReadPreference readPreference)
Creates an instance.
|
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
ConnectionSource |
getWriteConnectionSource()
Supply a connection source to a server that can be written to
|
void |
release()
Release a reference to this object.
|
ReadWriteBinding |
retain()
Retain an additional reference to this object.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCount, releasepublic ClusterBinding(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 ReadWriteBinding retain()
ReferenceCountedretain 在接口中 ReadBindingretain 在接口中 ReadWriteBindingretain 在接口中 ReferenceCountedretain 在接口中 WriteBindingpublic ReadPreference getReadPreference()
ReadBindinggetReadPreference 在接口中 ReadBindingpublic ConnectionSource getReadConnectionSource()
ReadBindinggetReadConnectionSource 在接口中 ReadBindingpublic ConnectionSource getWriteConnectionSource()
WriteBindinggetWriteConnectionSource 在接口中 WriteBindingpublic int getCount()
ReferenceCountedgetCount 在接口中 ReferenceCountedpublic void release()
ReferenceCountedrelease 在接口中 ReferenceCounted