]> git.mxchange.org Git - jaddressbook-lib.git/blobdiff - Addressbook/src/org/mxchange/addressbook/application/AddressbookApplication.java
Fixes for missing throws statements (because jcore has changed).
[jaddressbook-lib.git] / Addressbook / src / org / mxchange / addressbook / application / AddressbookApplication.java
index 66834d9bd750aaa62262e33257f53f5b9370d86b..ea26bc1ec1bbe7117f389c6c3a2a0fcd9254202d 100644 (file)
  */
 package org.mxchange.addressbook.application;
 
+import java.io.IOException;
 import java.text.MessageFormat;
 import org.mxchange.addressbook.BaseAddressbookSystem;
 import org.mxchange.addressbook.client.AddressbookClient;
 import org.mxchange.addressbook.client.console.ConsoleClient;
 import org.mxchange.addressbook.client.gui.SwingClient;
+import org.mxchange.jcore.BaseFrameworkSystem;
 import org.mxchange.jcore.application.Application;
 import org.mxchange.jcore.client.Client;
 import org.mxchange.jcore.exceptions.UnhandledUserChoiceException;
@@ -140,19 +142,14 @@ public class AddressbookApplication extends BaseAddressbookSystem implements App
 
        /**
         * Protected constructor
+        * @throws java.io.IOException If any IO error occurs
         */
-       protected AddressbookApplication () {
-               // Always init i18n bundle in this application
-               this.initBundle();
-       }
+       protected AddressbookApplication () throws IOException {
+               // Init properties file
+               this.initProperties();
 
-       /**
-        * Getter for printable application name
-        *
-        * @return A printable name
-        */
-       public static String printableTitle () {
-               return MessageFormat.format("{0} v{1}", APP_TITLE, APP_VERSION); //NOI18N
+               // Init bundle
+               this.initBundle();
        }
 
        /**
@@ -240,6 +237,21 @@ public class AddressbookApplication extends BaseAddressbookSystem implements App
                this.getLogger().debug("Main loop exit - shutting down ..."); //NOI18N
        }
 
+       /**
+        * Shuts down the application.
+        */
+       @Override
+       public void doShutdown () {
+               // Trace message
+               this.getLogger().trace("CALLED!"); //NOI18N
+               
+               // Shutdown client
+               this.getClient().doShutdown();
+               
+               this.getLogger().info("End of program (last line)"); //NOI18N
+               System.exit(0);
+       }
+
        /**
         * Enables console client by setting propper flag
         */
@@ -343,22 +355,22 @@ public class AddressbookApplication extends BaseAddressbookSystem implements App
         * @param args the command line arguments
         */
        public static void main (String[] args) {
-               // Start application
-               new AddressbookApplication().start(args);
+               try {
+                       // Start application
+                       new AddressbookApplication().start(args);
+               } catch (final IOException ex) {
+                       // Get instance
+                       BaseFrameworkSystem.getInstance().getLogger().catching(ex);
+                       System.exit(1);
+               }
        }
 
        /**
-        * Shuts down the application.
+        * Getter for printable application name
+        *
+        * @return A printable name
         */
-       @Override
-       public void doShutdown () {
-               // Trace message
-               this.getLogger().trace("CALLED!"); //NOI18N
-
-               // Shutdown client
-               this.getClient().doShutdown();
-
-               this.getLogger().info("End of program (last line)"); //NOI18N
-               System.exit(0);
+       public static String printableTitle () {
+               return MessageFormat.format("{0} v{1}", APP_TITLE, APP_VERSION); //NOI18N
        }
 }