Commit 0bd9cfe5 authored by Ali Saeed's avatar Ali Saeed

Update Application class to read port from user not from jar

parent b31a795c
......@@ -8,6 +8,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.Scanner;
public class Application implements Watcher {
private static final Logger logger = LoggerFactory.getLogger(Application.class);
......@@ -17,8 +18,11 @@ public class Application implements Watcher {
private ZooKeeper zooKeeper;
public static void main(String[] args) throws IOException, InterruptedException, KeeperException {
int currentServerPort = args.length == 1 ? Integer.parseInt(args[0]) : DEFAULT_PORT;
System.out.println("Enter Port!!!");
Scanner scanner = new Scanner(System.in);
int currentServerPort = 0;
currentServerPort = scanner.nextInt();
// int currentServerPort = args.length == 1 ? Integer.parseInt(args[0]) : DEFAULT_PORT;
Application application = new Application();
ZooKeeper zooKeeper = application.connectToZookeeper();
......
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