@ManagedObject public abstract class AbstractConnectionPool extends java.lang.Object implements ConnectionPool, Dumpable
ConnectionPool.Factory, ConnectionPool.Multiplexable
Modifier | Constructor and Description |
---|---|
protected |
AbstractConnectionPool(Destination destination,
int maxConnections,
Callback requester) |
Modifier and Type | Method and Description |
---|---|
Connection |
acquire()
Returns an idle connection, if available, or schedules the opening
of a new connection and returns
null . |
protected void |
acquired(Connection connection) |
protected abstract Connection |
activate() |
protected Connection |
active(Connection connection) |
void |
close()
Closes this ConnectionPool.
|
protected void |
close(java.util.Collection<Connection> connections) |
java.lang.String |
dump() |
int |
getConnectionCount() |
int |
getMaxConnectionCount() |
int |
getPendingCount() |
protected boolean |
idle(Connection connection,
boolean close) |
boolean |
isClosed() |
boolean |
isEmpty() |
protected abstract void |
onCreated(Connection connection) |
protected void |
proceed() |
protected void |
released(Connection connection) |
protected void |
removed(Connection connection) |
protected void |
tryCreate(int maxPending) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isActive, release, remove
dump, dump, dumpObject, dumpObjects, dumpSelf
protected AbstractConnectionPool(Destination destination, int maxConnections, Callback requester)
@ManagedAttribute(value="The max number of connections", readonly=true) public int getMaxConnectionCount()
@ManagedAttribute(value="The number of connections", readonly=true) public int getConnectionCount()
@ManagedAttribute(value="The number of pending connections", readonly=true) public int getPendingCount()
public boolean isEmpty()
isEmpty
in interface ConnectionPool
public boolean isClosed()
isClosed
in interface ConnectionPool
ConnectionPool.close()
public Connection acquire()
ConnectionPool
Returns an idle connection, if available, or schedules the opening
of a new connection and returns null
.
acquire
in interface ConnectionPool
protected void tryCreate(int maxPending)
protected abstract void onCreated(Connection connection)
protected void proceed()
protected abstract Connection activate()
protected Connection active(Connection connection)
protected void acquired(Connection connection)
protected boolean idle(Connection connection, boolean close)
protected void released(Connection connection)
protected void removed(Connection connection)
public void close()
ConnectionPool
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface ConnectionPool
ConnectionPool.isClosed()
protected void close(java.util.Collection<Connection> connections)
Copyright © 1995–2023 Webtide. All rights reserved.