diff options
Diffstat (limited to 'src/main/java/org/onap/music/main')
-rw-r--r-- | src/main/java/org/onap/music/main/MusicCore.java | 6 | ||||
-rwxr-xr-x | src/main/java/org/onap/music/main/PropertiesListener.java | 9 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/main/java/org/onap/music/main/MusicCore.java b/src/main/java/org/onap/music/main/MusicCore.java index 9f7b060b..98696bab 100644 --- a/src/main/java/org/onap/music/main/MusicCore.java +++ b/src/main/java/org/onap/music/main/MusicCore.java @@ -189,7 +189,7 @@ public class MusicCore { logger.info(EELFLoggerDelegate.applicationLogger,"Time taken to get lock state:" + (end - start) + " ms"); return mls; } catch (NullPointerException | MusicLockingException e) { - logger.error(EELFLoggerDelegate.errorLogger,e.getMessage(), AppMessages.INVALIDLOCK,ErrorSeverity.CRITICAL, ErrorTypes.LOCKINGERROR); + logger.error(EELFLoggerDelegate.errorLogger,e, AppMessages.INVALIDLOCK,ErrorSeverity.CRITICAL, ErrorTypes.LOCKINGERROR); } return null; } @@ -213,9 +213,9 @@ public class MusicCore { mls = releaseLock(currentLockHolder, voluntaryRelease); } } - } else + } else { logger.error(EELFLoggerDelegate.errorLogger,key, AppMessages.INVALIDLOCK,ErrorSeverity.CRITICAL, ErrorTypes.LOCKINGERROR); - + } /* * call the traditional acquire lock now and if the result returned is true, set the * begin time-stamp and lease period diff --git a/src/main/java/org/onap/music/main/PropertiesListener.java b/src/main/java/org/onap/music/main/PropertiesListener.java index 0ed18be2..026790ee 100755 --- a/src/main/java/org/onap/music/main/PropertiesListener.java +++ b/src/main/java/org/onap/music/main/PropertiesListener.java @@ -3,6 +3,7 @@ * org.onap.music * =================================================================== * Copyright (c) 2017 AT&T Intellectual Property + * Modifications Copyright (C) 2018 IBM. * =================================================================== * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +38,7 @@ import org.onap.music.eelf.logging.format.ErrorTypes; public class PropertiesListener implements ServletContextListener { private Properties prop; - + private static final String MUSIC_PROPERTIES="music.properties"; private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PropertiesListener.class); @Override @@ -51,8 +52,8 @@ public class PropertiesListener implements ServletContextListener { try { InputStream musicProps = null; projectProp.load(new FileInputStream(musicPropertiesFilePath)); - if (projectProp.containsKey("music.properties")) { - musicProps = new FileInputStream(projectProp.getProperty("music.properties")); + if (projectProp.containsKey(MUSIC_PROPERTIES)) { + musicProps = new FileInputStream(projectProp.getProperty(MUSIC_PROPERTIES)); } else { musicProps = new FileInputStream(MusicUtil.getMusicPropertiesFilePath()); } @@ -84,7 +85,7 @@ public class PropertiesListener implements ServletContextListener { case "music.rest.ip": MusicUtil.setMusicRestIp(prop.getProperty(key)); break; - case "music.properties": + case MUSIC_PROPERTIES: MusicUtil.setMusicPropertiesFilePath(prop.getProperty(key)); break; case "lock.lease.period": |