]> git.mxchange.org Git - jcore.git/commitdiff
Added debug message
authorRoland Haeder <roland@mxchange.org>
Wed, 19 Aug 2015 12:43:12 +0000 (14:43 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 19 Aug 2015 12:43:12 +0000 (14:43 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

src/org/mxchange/jcore/database/frontend/BaseDatabaseFrontend.java
src/org/mxchange/jcore/factory/database/backend/BackendFactory.java

index ca318f204d52cd9ea80c10718e844e7bc45e4e8c..7de1749910bdf0488bd116096e73feaa291d3f5a 100644 (file)
@@ -201,22 +201,25 @@ public abstract class BaseDatabaseFrontend extends BaseFrameworkSystem implement
        protected void initBackend () throws UnsupportedDatabaseBackendException, SQLException {
                // Trace message
                this.getLogger().trace("CALLED!"); //NOI18N
-               
+
                // Try it
                try {
                        // Try to get get instance from factory
                        DatabaseBackend backend = BackendFactory.createInstance(this);
-                       
+
+                       // Debug message
+                       this.getLogger().debug(MessageFormat.format("backend={0}", backend));
+
                        // Try to run a connect on it
                        backend.connectToDatabase();
-                       
+
                        // All fine so far, then set it here
                        this.setBackend(backend);
                } catch (final ClassNotFoundException | NoSuchMethodException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) {
                        // Continue to throw
                        throw new UnsupportedDatabaseBackendException(ex);
                }
-               
+
                // Trace message
                this.getLogger().trace("EXIT!"); //NOI18N
        }
index 821779b88a3931ea5a11b8bf47acf8593794ec72..5e161662355dca3b439f91ec6a1716e7b88aa59e 100644 (file)
@@ -48,6 +48,12 @@ public class BackendFactory extends BaseFrameworkSystem {
                // Trace message
                factory.getLogger().trace(MessageFormat.format("frontend={0} - CALLED!", frontend)); //NOI18N
 
+               // frontend must be set
+               if (frontend == null) {
+                       // Is null
+                       throw new NullPointerException("frontend is null");
+               }
+
                // Get property
                String className = factory.getProperty("database.backend.class"); //NOI18N