]> git.mxchange.org Git - jfinancials-lib.git/blob - Addressbook/src/org/mxchange/addressbook/manager/application/ApplicationManager.java
9afad3a739b4204aec042f2a18573d88a26d5c7e
[jfinancials-lib.git] / Addressbook / src / org / mxchange / addressbook / manager / application / ApplicationManager.java
1 /*\r
2  * Copyright (C) 2015 Roland Haeder\r
3  *\r
4  * This program is free software: you can redistribute it and/or modify\r
5  * it under the terms of the GNU General Public License as published by\r
6  * the Free Software Foundation, either version 3 of the License, or\r
7  * (at your option) any later version.\r
8  *\r
9  * This program is distributed in the hope that it will be useful,\r
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
12  * GNU General Public License for more details.\r
13  *\r
14  * You should have received a copy of the GNU General Public License\r
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
16  */\r
17 package org.mxchange.addressbook.manager.application;\r
18 \r
19 import org.mxchange.addressbook.application.Application;\r
20 import org.mxchange.addressbook.manager.BaseManager;\r
21 \r
22 /**\r
23  *\r
24  * @author Roland Haeder\r
25  */\r
26 public class ApplicationManager extends BaseManager implements ManageableApplication {\r
27 \r
28     /**\r
29      * Getter for application manager\r
30      * @param application An instance of a Application class\r
31      * @return\r
32      */\r
33     public static final ManageableApplication getManager (final Application application) {\r
34         // Get manager\r
35         ManageableApplication manager = new ApplicationManager(application);\r
36 \r
37         // Return manager\r
38         return manager;\r
39     }\r
40 \r
41     /**\r
42      * Constructor for this manager\r
43      * @param application An instance of an Application class\r
44      */\r
45     private ApplicationManager (final Application application) {\r
46         super();\r
47         \r
48         // Set application instance\r
49         this.setApplication (application);\r
50     }\r
51 \r
52     @Override\r
53     public void start () {\r
54         // Bootstrap application\r
55         this.getApplication().doBootstrap();\r
56 \r
57         // Run the main loop\r
58         this.getApplication().doMainLoop();\r
59     }\r
60 }\r