Fix Logger use
[openflowjava.git] / simple-client / src / main / java / org / opendaylight / openflowjava / protocol / impl / clients / SimpleClient.java
index fee80aa491d0b77445722e78fc4d61431d116cab..5e98e3d601ad5c7d9ed731b48ba0d37a15dbe549 100644 (file)
@@ -37,7 +37,7 @@ public class SimpleClient implements OFClient {
     private SettableFuture<Boolean> isOnlineFuture;
     private SettableFuture<Boolean> scenarioDone;
     private ScenarioHandler scenarioHandler;
-    
+
     /**
      * Constructor of class
      *
@@ -54,7 +54,7 @@ public class SimpleClient implements OFClient {
         isOnlineFuture = SettableFuture.create();
         scenarioDone = SettableFuture.create();
     }
-    
+
     /**
      * Starting class of {@link SimpleClient}
      */
@@ -73,7 +73,9 @@ public class SimpleClient implements OFClient {
 
             synchronized (scenarioHandler) {
                 LOGGER.debug("WAITING FOR SCENARIO");
-                scenarioHandler.wait();
+                while (! scenarioHandler.isScenarioFinished()) {
+                    scenarioHandler.wait();
+                }
             }
         } catch (Exception ex) {
             LOGGER.error(ex.getMessage(), ex);
@@ -113,8 +115,7 @@ public class SimpleClient implements OFClient {
         int port;
         SimpleClient sc;
         if (args.length != 3) {
-            LOGGER.error("Usage: " + SimpleClient.class.getSimpleName()
-                    + " <host> <port> <secured>");
+            LOGGER.error("Usage: {} <host> <port> <secured>", SimpleClient.class.getSimpleName());
             LOGGER.error("Trying to use default setting.");
             InetAddress ia = InetAddress.getLocalHost();
             InetAddress[] all = InetAddress.getAllByName(ia.getHostName());
@@ -145,4 +146,4 @@ public class SimpleClient implements OFClient {
     public void setScenarioHandler(ScenarioHandler scenario) {
         this.scenarioHandler = scenario;
     }
-}
\ No newline at end of file
+}