class ClientSessionBinding extends java.lang.Object implements ReadWriteBinding
| Modifier and Type | Class and Description |
|---|---|
private class |
ClientSessionBinding.SessionBindingConnectionSource |
| Modifier and Type | Field and Description |
|---|---|
private boolean |
ownsSession |
private ClientSession |
session |
private ClientSessionContext |
sessionContext |
private ReadWriteBinding |
wrapped |
| Constructor and Description |
|---|
ClientSessionBinding(ClientSession session,
boolean ownsSession,
ReadWriteBinding wrapped) |
| Modifier and Type | Method and Description |
|---|---|
private void |
closeSessionIfCountIsZero() |
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.
|
SessionContext |
getSessionContext()
Gets the session context for this binding.
|
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.
|
private final ReadWriteBinding wrapped
private final ClientSession session
private final boolean ownsSession
private final ClientSessionContext sessionContext
ClientSessionBinding(ClientSession session, boolean ownsSession, ReadWriteBinding wrapped)
public ReadPreference getReadPreference()
ReadBindinggetReadPreference in interface ReadBindingpublic int getCount()
ReferenceCountedgetCount in interface ReferenceCountedpublic ReadWriteBinding retain()
ReferenceCountedretain in interface ReadBindingretain in interface ReadWriteBindingretain in interface ReferenceCountedretain in interface WriteBindingpublic void release()
ReferenceCountedrelease in interface ReferenceCountedprivate void closeSessionIfCountIsZero()
public ConnectionSource getReadConnectionSource()
ReadBindinggetReadConnectionSource in interface ReadBindingpublic SessionContext getSessionContext()
ReadBindinggetSessionContext in interface ReadBindinggetSessionContext in interface WriteBindingpublic ConnectionSource getWriteConnectionSource()
WriteBindinggetWriteConnectionSource in interface WriteBinding