public class ServerSessionPool
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) static interface |
ServerSessionPool.Clock |
(package private) class |
ServerSessionPool.ServerSessionImpl |
private class |
ServerSessionPool.ServerSessionItemFactory |
Modifier and Type | Field and Description |
---|---|
private ServerSessionPool.Clock |
clock |
private boolean |
closed |
private java.util.List<BsonDocument> |
closedSessionIdentifiers |
private boolean |
closing |
private Cluster |
cluster |
private static int |
END_SESSIONS_BATCH_SIZE |
private ConcurrentPool<ServerSessionPool.ServerSessionImpl> |
serverSessionPool |
Constructor and Description |
---|
ServerSessionPool(Cluster cluster) |
ServerSessionPool(Cluster cluster,
ServerSessionPool.Clock clock) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
private void |
closeSession(ServerSessionPool.ServerSessionImpl serverSession) |
private void |
endClosedSessions() |
ServerSession |
get() |
int |
getInUseCount() |
void |
release(ServerSession serverSession) |
private boolean |
shouldPrune(ServerSessionPool.ServerSessionImpl serverSession) |
private static final int END_SESSIONS_BATCH_SIZE
private final ConcurrentPool<ServerSessionPool.ServerSessionImpl> serverSessionPool
private final Cluster cluster
private final ServerSessionPool.Clock clock
private volatile boolean closing
private volatile boolean closed
private final java.util.List<BsonDocument> closedSessionIdentifiers
public ServerSessionPool(Cluster cluster)
public ServerSessionPool(Cluster cluster, ServerSessionPool.Clock clock)
public ServerSession get()
public void release(ServerSession serverSession)
public void close()
public int getInUseCount()
private void closeSession(ServerSessionPool.ServerSessionImpl serverSession)
private void endClosedSessions()
private boolean shouldPrune(ServerSessionPool.ServerSessionImpl serverSession)