1 7 34 35 package com.sun.tools.example.debug.bdi; 36 37 import com.sun.jdi.ReferenceType; 38 import com.sun.jdi.request.*; 39 40 import java.util.ArrayList ; 41 import java.util.List ; 42 import java.util.Iterator ; 43 44 public class ExceptionSpec extends EventRequestSpec { 45 46 boolean notifyCaught; 47 boolean notifyUncaught; 48 49 ExceptionSpec(EventRequestSpecList specs, ReferenceTypeSpec refSpec, 50 boolean notifyCaught, boolean notifyUncaught) 51 { 52 super(specs, refSpec); 53 this.notifyCaught = notifyCaught; 54 this.notifyUncaught = notifyUncaught; 55 } 56 57 void notifySet(SpecListener listener, SpecEvent evt) { 58 listener.exceptionInterceptSet(evt); 59 } 60 61 void notifyDeferred(SpecListener listener, SpecEvent evt) { 62 listener.exceptionInterceptDeferred(evt); 63 } 64 65 void notifyResolved(SpecListener listener, SpecEvent evt) { 66 listener.exceptionInterceptResolved(evt); 67 } 68 69 void notifyDeleted(SpecListener listener, SpecEvent evt) { 70 listener.exceptionInterceptDeleted(evt); 71 } 72 73 void notifyError(SpecListener listener, SpecErrorEvent evt) { 74 listener.exceptionInterceptError(evt); 75 } 76 77 80 void resolve(ReferenceType refType) { 81 setRequest(refType.virtualMachine().eventRequestManager() 82 .createExceptionRequest(refType, 83 notifyCaught, notifyUncaught)); 84 } 85 86 public int hashCode() { 87 return refSpec.hashCode(); 88 } 89 90 public boolean equals(Object obj) { 91 if (obj instanceof ExceptionSpec) { 92 ExceptionSpec es = (ExceptionSpec)obj; 93 94 return refSpec.equals(es.refSpec); 95 } else { 96 return false; 97 } 98 } 99 100 public String toString() { 101 StringBuffer buffer = new StringBuffer ("exception catch "); 102 buffer.append(refSpec.toString()); 103 return buffer.toString(); 104 } 105 } 106 | Popular Tags |