]> git.mxchange.org Git - jbonuscard-lib.git/blobdiff - Addressbook/src/org/mxchange/addressbook/BaseFrameworkSystem.java
A lot more improvements:
[jbonuscard-lib.git] / Addressbook / src / org / mxchange / addressbook / BaseFrameworkSystem.java
index 431aeb456a8e49677e56f1aba655014fd1dc7f92..b43b42b54a49c3f2de6f9b5953f639957c76e461 100644 (file)
@@ -131,6 +131,15 @@ public class BaseFrameworkSystem implements FrameworkInterface {
                this.application = application;
        }
 
+       /**
+        * Getter for bundle instance
+        *
+        * @return Resource bundle
+        */
+       protected final ResourceBundle getBundle () {
+               return this.bundle;
+       }
+
        /**
         * Getter for logger
         *
@@ -159,11 +168,28 @@ public class BaseFrameworkSystem implements FrameworkInterface {
        }
 
        /**
-        * Getter for bundle instance
+        * Getter for human-readable string from given key
         *
-        * @return Resource bundle
+        * @param key Key to return
+        * @return Human-readable message
         */
-       protected final ResourceBundle getBundle () {
-               return this.bundle;
+       @Override
+       public final String getMessageStringFromKey (final String key) {
+               // Return message
+               return this.getBundle().getString(key);
+       }
+
+       /**
+        * Aborts program with given exception
+        * 
+        * @param       throwable Any type of Throwable
+        */
+       protected final void abortProgramWithException (final Throwable throwable) {
+               // Log exception ...
+               this.getLogger().catching(throwable);
+
+               // .. and exit
+               System.exit(1);
+
        }
 }