public interface ConnectionPool extends Closeable
Client-side connection pool abstraction.
Modifier and Type | Interface and Description |
---|---|
static interface |
ConnectionPool.Factory
Factory for ConnectionPool instances.
|
static interface |
ConnectionPool.Multiplexable
Marks a connection pool as supporting multiplexed connections.
|
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 . |
void |
close()
Closes this ConnectionPool.
|
boolean |
isActive(Connection connection) |
boolean |
isClosed() |
boolean |
isEmpty() |
boolean |
release(Connection connection)
Returns the given connection, previously obtained via
acquire() ,
back to this ConnectionPool. |
boolean |
remove(Connection connection)
Removes the given connection from this ConnectionPool.
|
boolean isActive(Connection connection)
connection
- the connection to testboolean isEmpty()
boolean isClosed()
close()
Connection acquire()
Returns an idle connection, if available, or schedules the opening
of a new connection and returns null
.
boolean release(Connection connection)
Returns the given connection, previously obtained via acquire()
,
back to this ConnectionPool.
connection
- the connection to releaseboolean remove(Connection connection)
Removes the given connection from this ConnectionPool.
connection
- the connection to removevoid close()
close
in interface AutoCloseable
close
in interface Closeable
isClosed()
Copyright © 2010 - 2020 Adobe. All Rights Reserved