]> git.mxchange.org Git - jcore.git/commitdiff
Introduced new exception MenuInitializationException
authorRoland Haeder <roland@mxchange.org>
Wed, 30 Sep 2015 06:57:17 +0000 (08:57 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 30 Sep 2015 06:57:17 +0000 (08:57 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

src/org/mxchange/jcore/application/Application.java
src/org/mxchange/jcore/exceptions/MenuInitializationException.java [new file with mode: 0644]
src/org/mxchange/jcore/manager/application/ApplicationManager.java
src/org/mxchange/jcore/manager/application/ManageableApplication.java

index ddc52aa22e1b20533b2989a4926ff4ad2c1c567e..9d01f772d2176c2ae085e9b7eb976e103ec3a8ee 100644 (file)
@@ -19,6 +19,7 @@ package org.mxchange.jcore.application;
 import java.io.IOException;
 import java.sql.SQLException;
 import org.mxchange.jcore.FrameworkInterface;
+import org.mxchange.jcore.exceptions.MenuInitializationException;
 
 /**
  *
@@ -33,8 +34,10 @@ public interface Application extends FrameworkInterface {
 
        /**
         * Run the main loop
+        * <p>
+        * @throws org.mxchange.jcore.exceptions.MenuInitializationException If the menu could not be initialized
         */
-       public void doMainLoop ();
+       public void doMainLoop () throws MenuInitializationException;
 
        /**
         * Shutdown the application
diff --git a/src/org/mxchange/jcore/exceptions/MenuInitializationException.java b/src/org/mxchange/jcore/exceptions/MenuInitializationException.java
new file mode 100644 (file)
index 0000000..d1727b2
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2015 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jcore.exceptions;
+
+/**
+ * This exception is thrown when the menu cannot be initialized.
+ * <p>
+ * @author Roland Haeder
+ */
+public class MenuInitializationException extends Exception {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 24_783_787_818_459_283L;
+
+       /**
+        * Constructor for bad menu instance and type
+        * <p>
+        * @param menu Bad menu instance (not implementing Menu)
+        * @param menuType Menu type
+        */
+       public MenuInitializationException (final Object menu, final String menuType) {
+       }
+
+}
index 84ff96d57a87396771525ea7c03223a2b83af18c..c20012b559c336eb2db4aa867bb138fd66220c58 100644 (file)
@@ -17,6 +17,7 @@
 package org.mxchange.jcore.manager.application;
 
 import org.mxchange.jcore.application.Application;
+import org.mxchange.jcore.exceptions.MenuInitializationException;
 import org.mxchange.jcore.manager.BaseManager;
 
 /**
@@ -77,7 +78,7 @@ public class ApplicationManager extends BaseManager implements ManageableApplica
        }
 
        @Override
-       public void start () {
+       public void start () throws MenuInitializationException {
                // Bootstrap application
                this.getApplication().doBootstrap();
 
index 24dfe6c338941cb8b1b4d173147da3bb3f8bc125..9c91fe738de24b156a9e73ef1ecafce0a165eb3d 100644 (file)
@@ -16,6 +16,7 @@
  */
 package org.mxchange.jcore.manager.application;
 
+import org.mxchange.jcore.exceptions.MenuInitializationException;
 import org.mxchange.jcore.manager.Manageable;
 
 /**
@@ -27,6 +28,8 @@ public interface ManageableApplication extends Manageable {
 
        /**
         * Launches application
+        * <p>
+        * @throws org.mxchange.jcore.exceptions.MenuInitializationException If the menu could not be initialized
         */
-       public void start ();
+       public void start () throws MenuInitializationException;
 }