1 package ch.ethz.prose.engine; 2 3 import java.lang.reflect.Method ; 4 5 import ch.ethz.jvmai.JoinPointKinds; 6 import ch.ethz.jvmai.ClassSpecific; 7 8 13 public class MethodRedefineRequest extends JoinPointRequest implements JoinPointKinds, ClassSpecific { 14 15 protected final Method oldMethod; 16 17 24 public MethodRedefineRequest(Method oldMethod, JoinPointManager o) { 25 super(o); 26 this.oldMethod = oldMethod; 27 } 28 29 public int getMask() { 30 return MASK_METHOD_REDEFINE_JP | MASK_CODE_JP; 31 } 32 33 public String getKind() { 34 return KIND_METHOD_REDEFINE_JP; 35 } 36 37 public Class getTargetClass() { 38 return oldMethod.getDeclaringClass(); 39 } 40 41 public Method getMethod() { 42 return oldMethod; 43 } 44 45 public boolean equals(Object other) { 46 MethodRedefineRequest otherReq; 47 if (other instanceof MethodRedefineRequest) 48 otherReq = (MethodRedefineRequest) other; 49 else 50 return false; 51 return oldMethod.equals(otherReq.oldMethod); 52 } 53 54 public int hashCode() { 55 return (getMethod().hashCode() + 2); 56 } 57 58 public String toString() { 59 return "MethodRedefineRequest on " + oldMethod.getDeclaringClass().getName() + "." + oldMethod.getName(); 60 } 61 62 protected void setWatch(Object listeners) { 63 throw new RuntimeException ("Not supported"); 64 } 65 66 protected void clearWatch() { 67 throw new RuntimeException ("Not supported"); 68 } 69 70 } 71 | Popular Tags |