01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.debug.jdi.tests;
11:
12: import com.sun.jdi.event.ClassPrepareEvent;
13: import com.sun.jdi.request.EventRequest;
14:
15: /**
16: * Listen for ClassPrepareEvent for a specific class.
17: */
18: public class ClassPrepareEventWaiter extends EventWaiter {
19: protected String fClassName;
20:
21: /**
22: * Constructor
23: * @param request
24: * @param shouldGo
25: * @param className
26: */
27: public ClassPrepareEventWaiter(EventRequest request,
28: boolean shouldGo, String className) {
29: super (request, shouldGo);
30: fClassName = className;
31: }
32:
33: /**
34: * @see org.eclipse.debug.jdi.tests.EventWaiter#classPrepare(com.sun.jdi.event.ClassPrepareEvent)
35: */
36: public boolean classPrepare(ClassPrepareEvent event) {
37: if (event.referenceType().name().equals(fClassName)) {
38: notifyEvent(event);
39: return fShouldGo;
40: }
41: return true;
42: }
43: }
|