Omslachtigheid van actions en type in event omgeschreven naar action enum met parameter voor type. Type hernoemd naar target, dat dekt de lading beter. Mogelijkheid om ook device als target te gebruiken? En op die manier feedback versturen? Het event is nu bedoeld om events van services naar de devices te versturen.
This commit is contained in:
@@ -1,20 +1,5 @@
|
||||
package pm.application;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import pm.Target;
|
||||
|
||||
import pm.action.Action;
|
||||
import pm.exception.ActionException;
|
||||
import pm.exception.ActionInvokeException;
|
||||
|
||||
public abstract class Application {
|
||||
public void invoke(Action action) throws ActionException {
|
||||
try {
|
||||
action.getMethod(this).invoke(this);
|
||||
return;
|
||||
} catch (IllegalArgumentException e) {
|
||||
} catch (IllegalAccessException e) {
|
||||
} catch (InvocationTargetException e) {}
|
||||
throw new ActionInvokeException();
|
||||
// Todo: informatie doorgeven over wat er precies is foutgegaan
|
||||
}
|
||||
}
|
||||
public abstract class Application extends Target {}
|
||||
14
java/src/pm/application/voorbeeld/Voorbeeld.java
Normal file
14
java/src/pm/application/voorbeeld/Voorbeeld.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package pm.application.voorbeeld;
|
||||
|
||||
import pm.application.Application;
|
||||
|
||||
public class Voorbeeld extends Application {
|
||||
public void start() throws Exception {
|
||||
System.out.println("jeheee!");
|
||||
//throw new Exception("GEK");
|
||||
}
|
||||
|
||||
public void test() {
|
||||
System.out.println("neheee!");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user