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