]> git.mxchange.org Git - jcoreee.git/commitdiff
Introduced initLoggerInstance() which every contructor needs to call, surely
authorRoland Häder <roland@mxchange.org>
Thu, 6 Jul 2017 19:52:05 +0000 (21:52 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 6 Jul 2017 19:52:05 +0000 (21:52 +0200)
after super() has been called.

Signed-off-by: Roland Häder <roland@mxchange.org>
src/org/mxchange/jcoreee/database/BaseDatabaseBean.java

index 71a92feef35163668c10a0149d38bdba5d795abb..8e3f9f31e760cc6138d34352169c8d9ff0853f42 100644 (file)
@@ -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
+        * <p>
+        * @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
-        * <p>
-        * @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
         * <p>