|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.littleshoot.util.ConnectionMaintainerImpl<T,ServerT>
T - The type of the object that identifies a server.ServerT - The type of the object that represents a connection to a
server.public final class ConnectionMaintainerImpl<T,ServerT>
An implementation of the connection maintainer interface.
| Constructor Summary | |
|---|---|
ConnectionMaintainerImpl(ConnectionEstablisher<T,ServerT> establisher,
CandidateProvider<T> candidateProvider,
int minNumConnected)
Constructs a new connection maintainer. |
|
| Method Summary | |
|---|---|
Collection<ServerT> |
getConnectedServers()
Returns a collection of the servers that are currently connected. |
Optional<ServerT> |
getMostRecentlyActive()
Returns the most recently active server. |
void |
start()
Starts this maintainer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ConnectionMaintainerImpl(ConnectionEstablisher<T,ServerT> establisher,
CandidateProvider<T> candidateProvider,
int minNumConnected)
establisher - The object used to establish connections.candidateProvider - The object that provides candidate servers with which to try
establishing connections.minNumConnected - The minimum number of connections to maintain.| Method Detail |
|---|
public void start()
ConnectionMaintainer
start in interface ConnectionMaintainer<ServerT>public Optional<ServerT> getMostRecentlyActive()
ConnectionMaintainer
getMostRecentlyActive in interface ConnectionMaintainer<ServerT>None object is returned. Otherwise, a
Some object with map entry of the most recently active
server is returned. The type of the server is determined by the
types used by the implementation. In the default implementation,
the type of the server is determined by the
ConnectionEstablisher that is used.public Collection<ServerT> getConnectedServers()
ConnectionMaintainer
getConnectedServers in interface ConnectionMaintainer<ServerT>ConnectionEstablisher that
is used.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||