1 22 23 package org.aspectj.debugger.request; 24 25 import org.aspectj.debugger.base.*; 26 27 import com.sun.jdi.*; 28 29 37 38 public class KillRequest extends ExpressionGettingRequest { 39 40 private String threadName; 41 42 public KillRequest(Debugger debugger, String threadName, String valueRep) { 43 super(debugger, valueRep); 44 this.threadName = threadName; 45 } 46 47 public Object go() throws NoVMException, DebuggerException { 48 Value value = getValue(); 49 if (!(value instanceof ObjectReference)) { 50 throw new DebuggerException("the <expr> must be an object"); 51 } 52 ObjectReference oref = (ObjectReference) value; 53 ThreadReference threadRef = debugger.getThread(threadName); 54 try { 55 threadRef.stop(oref); 56 } catch (InvalidTypeException ite) { 57 throw new DebuggerException(ite); 58 } 59 return threadRef; 60 } 61 } 62 | Popular Tags |