Commit eb57815b authored by amir.yosef's avatar amir.yosef

Adding Director

parent 5c89bdef
import builder.Director;
import builder.ServerBuilder;
import server.Server;
import java.io.IOException;
public class Main {
public static void main(String[] args) {
try {
Server.getInstance().start();
} catch (IOException e) {
System.err.println("Server failed to start: " + e.getMessage());
}
Director director = new Director();
ServerBuilder builder = new ServerBuilder();
director.buildMaster(builder);
builder.port(16379);
Server server = builder.build();
server.start();
}
}
\ No newline at end of file
package builder;
public class Director {
public void buildMaster(ServerBuilder builder) {
builder.role("Master");
}
public void buildReplica(ServerBuilder builder) {
builder.role("Replica");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment