+ public interface NodeSupplier {
+
+ Node supply(String hostname, int port);
+
+ }
+
+ public static class DefaultNodeSupplier implements NodeSupplier {
+
+ @Override
+ public Node supply(String hostname, int port) {
+ return new Node(hostname, port);
+ }
+
+ }
+
+ public interface ConnectionSupplier {
+
+ Connection supply(Node node, String identifier);
+
+ }
+
+ public static class DefaultConnectionSupplier implements ConnectionSupplier {
+
+ @Override
+ public Connection supply(Node node, String identifier) {
+ return new Connection(node, identifier);
+ }
+
+ }
+
+ public interface ClientSupplier {
+
+ Client supply(Connection connection, Command command) throws IOException;
+
+ }
+
+ public static class DefaultClientSupplier implements ClientSupplier {
+
+ @Override
+ public Client supply(Connection connection, Command command) throws IOException {
+ return new Client(connection, command);
+ }
+
+ }
+