1 27 package ch.ethz.prose.engine; 28 29 import java.util.HashSet ; 30 31 import ch.ethz.jvmai.JVMAspectInterface; 32 33 43 public abstract class JoinPointRequest { 44 45 public abstract int getMask(); 46 47 public abstract String getKind(); 48 49 transient protected final JoinPointManager owner; 50 51 57 protected JoinPointRequest(JoinPointManager o) 58 { 59 this.owner = o; 60 } 61 62 protected JoinPointRequest() 63 { 64 owner = null; 65 } 66 67 87 public void enableJoinPoint(Object listeners) 88 { 89 synchronized (owner.enabledJoinPoints) 90 { 91 if (owner.enabledJoinPoints.contains(this)) 92 return; 93 94 setWatch(listeners); 95 owner.enabledJoinPoints.add(this); 96 } 97 } 98 99 104 public void disableJoinPoint() 105 { 106 synchronized(owner.enabledJoinPoints) 107 { 108 if (!owner.enabledJoinPoints.contains(this)) 109 return; 110 clearWatch(); 111 owner.enabledJoinPoints.remove(this); 112 } 113 } 114 115 120 protected abstract void setWatch(Object listeners); 121 122 127 protected abstract void clearWatch(); 128 129 134 public abstract boolean equals(Object other); 135 136 141 public abstract int hashCode(); 142 143 } 144 145 146 | Popular Tags |