X-Git-Url: https://gerrit.onap.org/r/gitweb?p=dmaap%2Fmessagerouter%2Fmirroragent.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fcom%2Fatt%2Fnsa%2FdmaapMMAgent%2FMirrorMakerAgent.java;h=8f189b3b16278d926c73f0ed4ccc327ec1a2082c;hp=341e6bd8ee82a3d13d9ab0770f4f471092c91f4e;hb=eb61336d63865ab0e8319571660b81f7a76fec55;hpb=990f74107df811cbf04c88e892b763bf522ff5b2 diff --git a/src/main/java/com/att/nsa/dmaapMMAgent/MirrorMakerAgent.java b/src/main/java/com/att/nsa/dmaapMMAgent/MirrorMakerAgent.java index 341e6bd..8f189b3 100644 --- a/src/main/java/com/att/nsa/dmaapMMAgent/MirrorMakerAgent.java +++ b/src/main/java/com/att/nsa/dmaapMMAgent/MirrorMakerAgent.java @@ -36,6 +36,7 @@ import java.net.URL; import java.util.ArrayList; import java.util.Properties; +import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.jasypt.util.text.BasicTextEncryptor; @@ -152,6 +153,7 @@ public class MirrorMakerAgent { } input = new FileInputStream(mmagenthome + "/etc/" + agentName + propName + ".properties"); } catch (IOException ex) { + logger.error(" IOException will be handled " + ex); try { input = new FileInputStream(mmagenthome + "/etc/" + propName + ".properties"); Properties prop = new Properties(); @@ -166,7 +168,7 @@ public class MirrorMakerAgent { prop.store(out, ""); } catch (Exception e) { - e.printStackTrace(); + logger.error("Exception at checkPropertiesFile " +e); } } finally { if (input != null) { @@ -380,7 +382,7 @@ public class MirrorMakerAgent { } } logger.info("Adding new MirrorMaker:" + newMirrorMaker.name); - if (!exists && mirrorMakers != null) { + if (exists == false && mirrorMakers != null) { mirrorMakers.getListMirrorMaker().add(newMirrorMaker); } else if (exists == false && mirrorMakers == null) { mirrorMakers = new ListMirrorMaker(); @@ -440,6 +442,8 @@ public class MirrorMakerAgent { try { Thread.sleep(1000); } catch (InterruptedException e) { + logger.log(Level.WARN, "Interrupted!", e); + Thread.currentThread().interrupt(); } } catch (IOException ex) { ex.printStackTrace();