import java.io.IOException;
import java.util.Properties;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
public class SubscriberProps {
+ private static final Logger logger = LoggerFactory.getLogger(SubscriberProps.class);
+
private static SubscriberProps instance = null;
- private Properties properties;
+ private final Properties properties;
- private SubscriberProps(String propsPath) throws IOException{
+ private SubscriberProps(String propsPath) throws IOException {
properties = new Properties();
properties.load(getClass().getClassLoader().getResourceAsStream(propsPath));
}
+ /**
+ * Get instance of subscriber properties.
+ * @param propsPath path to properties file
+ * @return SubscriberProps object
+ */
public static SubscriberProps getInstance(String propsPath) {
- if(instance == null) {
+ if (instance == null) {
try {
instance = new SubscriberProps(propsPath);
} catch (IOException ioe) {
- ioe.printStackTrace();
+ logger.error("IO Exception: " + ioe.getMessage(), ioe);
}
}
return instance;