1 package dst.ass2.aop.sample;
3 import org.springframework.aop.support.AopUtils;
5 import dst.ass2.aop.IPluginExecutable;
6 import dst.ass2.aop.event.EventBus;
7 import dst.ass2.aop.event.EventType;
8 import dst.ass2.aop.logging.Invisible;
9 import dst.ass2.aop.management.Timeout;
11 public class InterruptedPluginExecutable implements IPluginExecutable {
12 private boolean interrupted = false;
17 public void execute() {
18 EventBus eventBus = EventBus.getInstance();
19 eventBus.add(EventType.PLUGIN_START, this, AopUtils.getTargetClass(this).getSimpleName() + " is executed!");
21 while (!interrupted) {
24 } catch (InterruptedException e) {
25 // Should not happen but is not critical so the stack trace is printed to grab some attention ;-)
30 eventBus.add(EventType.PLUGIN_END, this, AopUtils.getTargetClass(this).getSimpleName() + " is finished!");
34 public void interrupted() {