]> git.mxchange.org Git - addressbook-lib.git/blobdiff - Addressbook/src/org/mxchange/addressbook/application/AddressbookApplication.java
the contact manager instance only exists when initFrame() is called and not on object...
[addressbook-lib.git] / Addressbook / src / org / mxchange / addressbook / application / AddressbookApplication.java
index 0b6e918d4f14b2ff39e18c3c94b055c2def6f14e..788c940ed3c41eb082ab699fcda3f03383381a24 100644 (file)
@@ -136,6 +136,15 @@ public class AddressbookApplication extends BaseFrameworkSystem implements Appli
      */\r
     private boolean guiClient = false;\r
 \r
+    /**\r
+     * Getter for printable application name\r
+     * \r
+     * @return A printable name\r
+     */\r
+    public static String printableTitle () {\r
+       return MessageFormat.format("{0} v{1}", APP_TITLE, APP_VERSION);\r
+    }\r
+\r
     /**\r
      * Bootstraps application\r
      */\r
@@ -289,7 +298,9 @@ public class AddressbookApplication extends BaseFrameworkSystem implements Appli
        // Launch application\r
        ApplicationManager.getManager(this).start();\r
 \r
-       this.getLogger().info("End of program (last line)");\r
+       // Good bye, but this should not be reached ...\r
+       this.getLogger().warn("Unusual exit reached.");\r
+       this.doShutdown();\r
     }\r
 \r
     /**\r
@@ -301,4 +312,16 @@ public class AddressbookApplication extends BaseFrameworkSystem implements Appli
        // Start application\r
        new AddressbookApplication().start(args);\r
     }\r
+\r
+    /**\r
+     * Shuts down the application.\r
+     */\r
+    @Override\r
+    public void doShutdown () {\r
+       // Shutdown client\r
+       this.getClient().doShutdown();\r
+\r
+       this.getLogger().info("End of program (last line)");\r
+       System.exit(0);\r
+    }\r
 }\r