From 479979d00f68f66eae2920cab2dc7051fafa01fd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 6 Jul 2017 21:52:05 +0200 Subject: [PATCH] Introduced initLoggerInstance() which every contructor needs to call, surely after super() has been called. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../jcoreee/database/BaseDatabaseBean.java | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) 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 *

-- 2.39.5