Add jrt supervisor as constructor parameter
@@ -28,7 +28,7 @@ public class JRTConnectionPool implements ConnectionPool {
private static final Logger log = Logger.getLogger(JRTConnectionPool.class.getName());
- private final Supervisor supervisor = new Supervisor(new Transport());
+ private final Supervisor supervisor;
private final Map<String, JRTConnection> connections = new LinkedHashMap<>();
// The config sources used by this connection pool.
@@ -38,6 +38,11 @@ public class JRTConnectionPool implements ConnectionPool {
private volatile JRTConnection currentConnection;
public JRTConnectionPool(ConfigSourceSet sourceSet) {
+ this(new Supervisor(new Transport()), sourceSet);
+ }
+
+ public JRTConnectionPool(Supervisor supervisor, ConfigSourceSet sourceSet) {
+ this.supervisor = supervisor;
addSources(sourceSet);
}
