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()
ReadBinding
getReadPreference
in interface ReadBinding
public int getCount()
ReferenceCounted
getCount
in interface ReferenceCounted
public ReadWriteBinding retain()
ReferenceCounted
retain
in interface ReadBinding
retain
in interface ReadWriteBinding
retain
in interface ReferenceCounted
retain
in interface WriteBinding
public void release()
ReferenceCounted
release
in interface ReferenceCounted
private void closeSessionIfCountIsZero()
public ConnectionSource getReadConnectionSource()
ReadBinding
getReadConnectionSource
in interface ReadBinding
public SessionContext getSessionContext()
ReadBinding
getSessionContext
in interface ReadBinding
getSessionContext
in interface WriteBinding
public ConnectionSource getWriteConnectionSource()
WriteBinding
getWriteConnectionSource
in interface WriteBinding