1 22 23 package org.aspectj.debugger.request; 24 25 import org.aspectj.debugger.base.*; 26 27 import com.sun.jdi.event.*; 28 29 37 38 public class MonitorRequest extends Request implements StopListener { 39 40 private String command; 41 private int number; 42 43 public MonitorRequest(Debugger debugger, String command, int number) { 44 super(debugger); 45 this.command = command; 46 this.number = number; 47 } 48 49 public Object go() throws NoVMException, DebuggerException { 50 if (!(command.startsWith("monitor"))) { 51 debugger.addMonitorRequest(this); 52 } 53 return command; 54 } 55 56 public int getNumber() { 57 return number; 58 } 59 60 public String getCommand() { 61 return command; 62 } 63 64 public boolean equals(Object other) { 65 if (!(other instanceof MonitorRequest)) { 66 return super.equals(other); 67 } 68 return ((MonitorRequest) other).getNumber() == getNumber(); 69 } 70 71 public String toString() { 72 return number + ": " + command; 73 } 74 75 76 public void accessWatchpointEvent(AccessWatchpointEvent e) { 77 debugger.execute(command); 78 } 79 public void breakpointEvent(BreakpointEvent e) { 80 debugger.execute(command); 81 } 82 public void exceptionEvent(ExceptionEvent e) { 83 debugger.execute(command); 84 } 85 public void modificationWatchpointEvent(ModificationWatchpointEvent e) { 86 debugger.execute(command); 87 } 88 public void stepEvent(StepEvent e) { 89 debugger.execute(command); 90 } 91 } 92 | Popular Tags |