Class AbstractConnectionPool
- All Implemented Interfaces:
Closeable,AutoCloseable,ConnectionPool,Container,Destroyable,Dumpable,Dumpable.DumpableContainer,LifeCycle,Sweeper.Sweepable
- Direct Known Subclasses:
DuplexConnectionPool,MultiplexConnectionPool
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListenerNested classes/interfaces inherited from interface org.eclipse.jetty.client.ConnectionPool
ConnectionPool.Factory, ConnectionPool.MultiplexableNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionacquire()Deprecated.Returns an idle connection, if available, or schedules the opening of a new connection and returnsnull.voidclose()Deprecated.Closes this ConnectionPool.voiddump(Appendable out, String indent) Deprecated.Dump this object (and children) into an Appendable using the provided indent after any new lines.intDeprecated.Deprecated.Relying on this method indicates a reliance on the implementation details.intDeprecated.intDeprecated.Deprecated.Relying on this method indicates a reliance on the implementation details.intDeprecated.longDeprecated.Get the max usage duration in milliseconds of the pool's connections.intDeprecated.intDeprecated.usegetPendingConnectionCount()insteadbooleanisActive(Connection connection) Deprecated.booleanisClosed()Deprecated.booleanisEmpty()Deprecated.booleanDeprecated.preCreateConnections(int connectionCount) Deprecated.Optionally pre-create up toconnectionCountconnections so they are immediately ready for use.booleanrelease(Connection connection) Deprecated.Returns the given connection, previously obtained viaConnectionPool.acquire(), back to this ConnectionPool.booleanremove(Connection connection) Deprecated.Removes the given connection from this ConnectionPool.voidsetMaxDuration(long maxDurationInMs) Deprecated.voidsetMaximizeConnections(boolean maximizeConnections) Deprecated.Sets whether the number of connections should be maximized.booleansweep()Deprecated.toString()Deprecated.Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dumpObject, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, unmanage, updateBean, updateBean, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
Method Details
-
preCreateConnections
Deprecated.Description copied from interface:ConnectionPoolOptionally pre-create up toconnectionCountconnections so they are immediately ready for use.- Specified by:
preCreateConnectionsin interfaceConnectionPool- Parameters:
connectionCount- the number of connections to pre-start.
-
getMaxDuration
@ManagedAttribute("The maximum duration in milliseconds a connection can be used for before it gets closed") public long getMaxDuration()Deprecated.Get the max usage duration in milliseconds of the pool's connections. Values
0and negative mean that there is no limit.This only guarantees that a connection cannot be acquired after the configured duration elapses, so that is only enforced when
acquire()is called. If a pool stays completely idle for a duration longer than the value returned by this method, the max duration will not be enforced. It's up to the idle timeout mechanism (seeHttpClient.getIdleTimeout()) to handle closing idle connections. -
setMaxDuration
public void setMaxDuration(long maxDurationInMs) Deprecated. -
getActiveConnectionCount
@ManagedAttribute(value="The number of active connections", readonly=true) public int getActiveConnectionCount()Deprecated. -
getIdleConnectionCount
@ManagedAttribute(value="The number of idle connections", readonly=true) public int getIdleConnectionCount()Deprecated. -
getMaxConnectionCount
@ManagedAttribute(value="The max number of connections", readonly=true) public int getMaxConnectionCount()Deprecated. -
getConnectionCount
Deprecated. -
getPendingCount
@ManagedAttribute(value="The number of pending connections", readonly=true) @Deprecated public int getPendingCount()Deprecated.usegetPendingConnectionCount()instead- Returns:
- the number of pending connections
-
getPendingConnectionCount
@ManagedAttribute(value="The number of pending connections", readonly=true) public int getPendingConnectionCount()Deprecated. -
isEmpty
public boolean isEmpty()Deprecated.- Specified by:
isEmptyin interfaceConnectionPool- Returns:
- whether this ConnectionPool has no open connections
-
isClosed
Deprecated.- Specified by:
isClosedin interfaceConnectionPool- Returns:
- whether this ConnectionPool has been closed
- See Also:
-
isMaximizeConnections
@ManagedAttribute("Whether the pool tries to maximize the number of connections used") public boolean isMaximizeConnections()Deprecated. -
setMaximizeConnections
public void setMaximizeConnections(boolean maximizeConnections) Deprecated.Sets whether the number of connections should be maximized.
- Parameters:
maximizeConnections- whether the number of connections should be maximized
-
acquire
Deprecated.Description copied from interface:ConnectionPoolReturns an idle connection, if available, or schedules the opening of a new connection and returns
null.- Specified by:
acquirein interfaceConnectionPool- Returns:
- an available connection, or null
-
isActive
Deprecated.- Specified by:
isActivein interfaceConnectionPool- Parameters:
connection- the connection to test- Returns:
- whether the given connection is currently in use
-
release
Deprecated.Description copied from interface:ConnectionPoolReturns the given connection, previously obtained via
ConnectionPool.acquire(), back to this ConnectionPool.- Specified by:
releasein interfaceConnectionPool- Parameters:
connection- the connection to release- Returns:
- true if the connection has been released, false if the connection should be closed
-
remove
Deprecated.Description copied from interface:ConnectionPoolRemoves the given connection from this ConnectionPool.
- Specified by:
removein interfaceConnectionPool- Parameters:
connection- the connection to remove- Returns:
- true if the connection was removed from this ConnectionPool
-
getIdleConnections
Deprecated.Relying on this method indicates a reliance on the implementation details.- Returns:
- an unmodifiable queue working as a view of the idle connections.
-
getActiveConnections
Deprecated.Relying on this method indicates a reliance on the implementation details.- Returns:
- an unmodifiable collection working as a view of the active connections.
-
close
public void close()Deprecated.Description copied from interface:ConnectionPoolCloses this ConnectionPool.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceConnectionPool- See Also:
-
dump
Deprecated.Description copied from interface:DumpableDump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.- Specified by:
dumpin interfaceDumpable- Overrides:
dumpin classContainerLifeCycle- Parameters:
out- The appendable to dump toindent- The indent to apply after any new lines.- Throws:
IOException- if unable to write to Appendable
-
sweep
public boolean sweep()Deprecated.- Specified by:
sweepin interfaceSweeper.Sweepable- Returns:
- whether this resource should be swept
-
toString
Deprecated.- Overrides:
toStringin classAbstractLifeCycle
-