1 6 7 package fr.emn.info.eaop.aspect; 8 9 import fr.emn.info.eaop.Monitor; 10 import fr.emn.info.eaop.event.*; 11 12 import java.util.*; 13 import java.lang.reflect.*; 14 import java.io.*; 15 16 17 24 25 public abstract class Aspect extends Coroutining { 26 27 public boolean isRunning; 28 public String name = this.getClass().toString(); 29 30 public Aspect() { 31 this(null); 32 } 33 34 public Aspect(AspectS up) { 35 super(up); 36 } 37 38 public void run() { 39 Event.names.push(this.name); 40 super.run(); 41 } 42 43 51 public Event nextEvent() { 52 Event.names.pop(); 53 this.isRunning = false; 54 this.block(); 55 this.isRunning = true; 56 Event.names.push(this.name); 57 this.isCrosscutting = false; 58 return this.currentEvent(); 59 } 60 61 64 public Event currentEvent() { 65 return Monitor.monitor.currentEvent(); 66 } 67 68 72 public void go() { 73 if (! this.isRunning) { 74 super.go(); 75 } 76 } 77 78 84 public void insert(AspectS a) { 85 this.up.insert(this, a); 86 } 87 88 93 public void insert(AspectS child, AspectS newAspect) { 94 System.out.println("AspectS.insert(AspectS,AspectS) abstract method never to be called"); 95 System.exit(0); 96 } 97 } 98 | Popular Tags |