Structuur consequenter gemaakt met initialise en exit methoden. De start methode wordt gereserveerd voor wanneer er een Thread moet worden gestart. Exceptions georganiseerd, hierbij opletten op het doorgeven van exceptions vanuit Threads! Poging tot het dynamisch toevoegen van devices is niet helemaal gelukt.
This commit is contained in:
@@ -1,7 +1,22 @@
|
||||
package pm;
|
||||
|
||||
import pm.exception.application.ApplicationExitException;
|
||||
import pm.exception.application.ApplicationInitialiseException;
|
||||
import pm.listener.ActionListener;
|
||||
|
||||
public abstract class Application extends ActionListener {
|
||||
public void exit() {}
|
||||
public abstract class Application extends ActionListener {
|
||||
public void run() {
|
||||
try {
|
||||
initialise();
|
||||
super.run();
|
||||
} catch (ApplicationInitialiseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void initialise() throws ApplicationInitialiseException {}
|
||||
|
||||
public void exit() throws ApplicationExitException {
|
||||
stop();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user