@ManagedObject public class RoundRobinConnectionPool extends MultiplexConnectionPool
A ConnectionPool
that attempts to provide connections using a round-robin algorithm.
The round-robin behavior is almost impossible to achieve for several reasons:
Do not expect this class to provide connections in a perfect recurring sequence such as
c0, c1, ..., cN-1, c0, c1, ..., cN-1, c0, c1, ...
because that is impossible to
achieve in a real environment.
This class will just attempt a best-effort to provide the connections in a sequential order,
but most likely the order will be quasi-random.
Applications using this class should pre-create
the connections to ensure that they are already opened when the application starts to requests
them, otherwise the first connection that is opened may be used multiple times before the others
are opened, resulting in a behavior that is more random-like than more round-robin-like (and
that confirms that round-robin behavior is almost impossible to achieve).
RandomConnectionPool
AbstractLifeCycle.AbstractLifeCycleListener
ConnectionPool.Factory, ConnectionPool.Multiplexable
Dumpable.DumpableContainer
Container.InheritedListener, Container.Listener
LifeCycle.Listener
Constructor and Description |
---|
RoundRobinConnectionPool(HttpDestination destination,
int maxConnections,
Callback requester) |
RoundRobinConnectionPool(HttpDestination destination,
int maxConnections,
Callback requester,
int maxMultiplex) |
getMaxMultiplex, getMaxUsageCount, setMaxMultiplex, setMaxUsageCount
acquire, acquire, acquired, activate, close, deactivate, doStop, dump, getActiveConnectionCount, getActiveConnections, getConnectionCount, getIdleConnectionCount, getIdleConnections, getMaxConnectionCount, getMaxDuration, getPendingConnectionCount, getPendingCount, idle, isActive, isClosed, isEmpty, isMaximizeConnections, onCreated, preCreateConnections, proceed, release, released, remove, remove, removed, setMaxDuration, setMaximizeConnections, sweep, toString, tryCreate
addBean, addBean, addEventListener, addManaged, contains, destroy, doStart, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeans
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
dump, dump, dumpContainer, dumpIterable, dumpMapEntries, dumpObject, dumpObjects, dumpSelf, named
isDumpable
public RoundRobinConnectionPool(HttpDestination destination, int maxConnections, Callback requester)
public RoundRobinConnectionPool(HttpDestination destination, int maxConnections, Callback requester, int maxMultiplex)
Copyright © 1995–2021 Webtide. All rights reserved.