From: Roland Häder Date: Thu, 6 Jul 2017 19:52:05 +0000 (+0200) Subject: Introduced initLoggerInstance() which every contructor needs to call, surely X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=479979d00f68f66eae2920cab2dc7051fafa01fd;p=jcore-utils.git Introduced initLoggerInstance() which every contructor needs to call, surely after super() has been called. Signed-off-by: Roland Häder --- diff --git a/src/org/mxchange/jcoreee/database/BaseDatabaseBean.java b/src/org/mxchange/jcoreee/database/BaseDatabaseBean.java index 71a92fe..8e3f9f3 100644 --- a/src/org/mxchange/jcoreee/database/BaseDatabaseBean.java +++ b/src/org/mxchange/jcoreee/database/BaseDatabaseBean.java @@ -61,6 +61,28 @@ public abstract class BaseDatabaseBean extends BaseBean { // Call super constructor super(); + // Init logger instance + this.initLoggerInstance(); + } + + /** + * Constructor with queue factory JNDI and queue JNDI names + *

+ * @param factoryJndi JNDI name for queue factory + * @param queueJndi JNDI name for email queue + */ + protected BaseDatabaseBean (final String factoryJndi, final String queueJndi) { + // Call super constructor + super(factoryJndi, queueJndi); + + // Init logger instance + this.initLoggerInstance(); + } + + /** + * Initializes logger instance + */ + private void initLoggerInstance () { try { // Get initial context Context context = new InitialContext(); @@ -73,17 +95,6 @@ public abstract class BaseDatabaseBean extends BaseBean { } } - /** - * Constructor with queue factory JNDI and queue JNDI names - *

- * @param factoryJndi JNDI name for queue factory - * @param queueJndi JNDI name for email queue - */ - protected BaseDatabaseBean (final String factoryJndi, final String queueJndi) { - // Call super constructor - super(factoryJndi, queueJndi); - } - /** * Getter for connection instance *