Action invoke systeem verbeterd en nette exceptions geintroduceerd.

This commit is contained in:
2011-02-03 14:41:12 +00:00
parent 76fdef60be
commit e9a3cd661f
12 changed files with 100 additions and 48 deletions

View File

@@ -1,15 +1,20 @@
package pm.application;
import java.lang.reflect.InvocationTargetException;
import pm.action.Action;
import pm.exception.ActionException;
import pm.exception.ActionInvokeException;
public abstract class Application {
public void invoke(Action action) throws Exception {
public void invoke(Action action) throws ActionException {
try {
action.getMethod(this).invoke(this);
} catch (Exception e) {
throw new Exception("Failed to invoke action");
}
return;
} catch (IllegalArgumentException e) {
} catch (IllegalAccessException e) {
} catch (InvocationTargetException e) {}
throw new ActionInvokeException();
// Todo: informatie doorgeven over wat er precies is foutgegaan
}
protected abstract void start();
}