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:
2011-02-04 21:23:01 +00:00
parent df91eab859
commit 1c61ac62fd
11 changed files with 77 additions and 60 deletions

View File

@@ -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 {}

View 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!");
}
}