Interface ConnectionFinder<C extends Connection>
public interface ConnectionFinder<C extends Connection>
An instance of a ConnectionFinder may be supplied to the
OutboundConnectionCache.get method.
-
Method Summary
Modifier and TypeMethodDescriptionfind(ContactInfo<C> cinfo, Collection<C> idleConnections, Collection<C> busyConnections) Method that searches idleConnections and busyConnections for the best connection.
-
Method Details
-
find
C find(ContactInfo<C> cinfo, Collection<C> idleConnections, Collection<C> busyConnections) throws IOException Method that searches idleConnections and busyConnections for the best connection. May return null if no best connection exists. May create a new connection and return it.- Parameters:
cinfo- info to match in the searchidleConnections- idle connections to searchbusyConnections- busy connections to search- Returns:
- the best connection
- Throws:
IOException- if an error occurred
-