< prev index next >

src/jdk.jdi/share/classes/com/sun/tools/jdi/EventRequestManagerImpl.java

Print this page

279         public final void putProperty(Object key, Object value) {
280             if (value != null) {
281                 getProperties().put(key, value);
282             } else {
283                 getProperties().remove(key);
284             }
285         }
286     }
287 
288     abstract class ThreadVisibleEventRequestImpl extends EventRequestImpl {
289         public synchronized void addThreadFilter(ThreadReference thread) {
290             validateMirror(thread);
291             if (isEnabled() || deleted) {
292                 throw invalidState();
293             }
294             filters.add(JDWP.EventRequest.Set.Modifier.ThreadOnly
295                                       .create((ThreadReferenceImpl)thread));
296         }
297     }
298 









299     abstract class ClassVisibleEventRequestImpl
300                                   extends ThreadVisibleEventRequestImpl {
301         public synchronized void addClassFilter(ReferenceType clazz) {
302             validateMirror(clazz);
303             if (isEnabled() || deleted) {
304                 throw invalidState();
305             }
306             filters.add(JDWP.EventRequest.Set.Modifier.ClassOnly
307                                       .create((ReferenceTypeImpl)clazz));
308         }
309 
310         public synchronized void addClassFilter(String classPattern) {
311             if (isEnabled() || deleted) {
312                 throw invalidState();
313             }
314             if (classPattern == null) {
315                 throw new NullPointerException();
316             }
317             filters.add(JDWP.EventRequest.Set.Modifier.ClassMatch
318                                       .create(classPattern));

628             return depth;
629         }
630 
631         public int size() {
632             return size;
633         }
634 
635         public ThreadReference thread() {
636             return thread;
637         }
638 
639         int eventCmd() {
640             return JDWP.EventKind.SINGLE_STEP;
641         }
642 
643         public String toString() {
644             return "step request " + thread() + state();
645         }
646     }
647 
648     class ThreadDeathRequestImpl extends ThreadVisibleEventRequestImpl
649                                  implements ThreadDeathRequest {
650         ThreadDeathRequestImpl() {
651             requestList().add(this);
652         }
653 
654         int eventCmd() {
655             return JDWP.EventKind.THREAD_DEATH;
656         }
657 
658         public String toString() {
659             return "thread death request " + state();
660         }
661     }
662 
663     class ThreadStartRequestImpl extends ThreadVisibleEventRequestImpl
664                                  implements ThreadStartRequest {
665         ThreadStartRequestImpl() {
666             requestList().add(this);
667         }
668 
669         int eventCmd() {
670             return JDWP.EventKind.THREAD_START;
671         }
672 
673         public String toString() {
674             return "thread start request " + state();
675         }
676     }
677 
678     abstract class WatchpointRequestImpl extends ClassVisibleEventRequestImpl
679                                          implements WatchpointRequest {
680         final Field field;
681 
682         WatchpointRequestImpl(Field field) {
683             this.field = field;

279         public final void putProperty(Object key, Object value) {
280             if (value != null) {
281                 getProperties().put(key, value);
282             } else {
283                 getProperties().remove(key);
284             }
285         }
286     }
287 
288     abstract class ThreadVisibleEventRequestImpl extends EventRequestImpl {
289         public synchronized void addThreadFilter(ThreadReference thread) {
290             validateMirror(thread);
291             if (isEnabled() || deleted) {
292                 throw invalidState();
293             }
294             filters.add(JDWP.EventRequest.Set.Modifier.ThreadOnly
295                                       .create((ThreadReferenceImpl)thread));
296         }
297     }
298 
299     abstract class ThreadLifecycleEventRequestImpl extends ThreadVisibleEventRequestImpl {
300         public synchronized void addPlatformThreadsOnlyFilter() {
301             if (isEnabled() || deleted) {
302                 throw invalidState();
303             }
304             filters.add(JDWP.EventRequest.Set.Modifier.PlatformThreadsOnly.create());
305         }
306     }
307 
308     abstract class ClassVisibleEventRequestImpl
309                                   extends ThreadVisibleEventRequestImpl {
310         public synchronized void addClassFilter(ReferenceType clazz) {
311             validateMirror(clazz);
312             if (isEnabled() || deleted) {
313                 throw invalidState();
314             }
315             filters.add(JDWP.EventRequest.Set.Modifier.ClassOnly
316                                       .create((ReferenceTypeImpl)clazz));
317         }
318 
319         public synchronized void addClassFilter(String classPattern) {
320             if (isEnabled() || deleted) {
321                 throw invalidState();
322             }
323             if (classPattern == null) {
324                 throw new NullPointerException();
325             }
326             filters.add(JDWP.EventRequest.Set.Modifier.ClassMatch
327                                       .create(classPattern));

637             return depth;
638         }
639 
640         public int size() {
641             return size;
642         }
643 
644         public ThreadReference thread() {
645             return thread;
646         }
647 
648         int eventCmd() {
649             return JDWP.EventKind.SINGLE_STEP;
650         }
651 
652         public String toString() {
653             return "step request " + thread() + state();
654         }
655     }
656 
657     class ThreadDeathRequestImpl extends ThreadLifecycleEventRequestImpl
658                                  implements ThreadDeathRequest {
659         ThreadDeathRequestImpl() {
660             requestList().add(this);
661         }
662 
663         int eventCmd() {
664             return JDWP.EventKind.THREAD_DEATH;
665         }
666 
667         public String toString() {
668             return "thread death request " + state();
669         }
670     }
671 
672     class ThreadStartRequestImpl extends ThreadLifecycleEventRequestImpl
673                                  implements ThreadStartRequest {
674         ThreadStartRequestImpl() {
675             requestList().add(this);
676         }
677 
678         int eventCmd() {
679             return JDWP.EventKind.THREAD_START;
680         }
681 
682         public String toString() {
683             return "thread start request " + state();
684         }
685     }
686 
687     abstract class WatchpointRequestImpl extends ClassVisibleEventRequestImpl
688                                          implements WatchpointRequest {
689         final Field field;
690 
691         WatchpointRequestImpl(Field field) {
692             this.field = field;
< prev index next >