KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdi > internal > event > BreakpointEventImpl


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdi.internal.event;
12
13
14 import java.io.DataInputStream JavaDoc;
15 import java.io.IOException JavaDoc;
16
17 import org.eclipse.jdi.internal.MirrorImpl;
18 import org.eclipse.jdi.internal.ThreadReferenceImpl;
19 import org.eclipse.jdi.internal.VirtualMachineImpl;
20 import org.eclipse.jdi.internal.request.RequestID;
21
22 import com.sun.jdi.event.BreakpointEvent;
23
24 /**
25  * this class implements the corresponding interfaces
26  * declared by the JDI specification. See the com.sun.jdi package
27  * for more information.
28  *
29  */

30 public class BreakpointEventImpl extends LocatableEventImpl implements BreakpointEvent {
31     /** Jdwp Event Kind. */
32     public static final byte EVENT_KIND = EVENT_BREAKPOINT;
33
34     /**
35      * Creates new BreakpointEventImpl.
36      */

37     private BreakpointEventImpl(VirtualMachineImpl vmImpl, RequestID requestID) {
38         super("BreakpointEvent", vmImpl, requestID); //$NON-NLS-1$
39
}
40     
41     /**
42      * @return Creates, reads and returns new EventImpl, of which requestID has already been read.
43      */

44     public static BreakpointEventImpl read(MirrorImpl target, RequestID requestID, DataInputStream JavaDoc dataInStream) throws IOException JavaDoc {
45         VirtualMachineImpl vmImpl = target.virtualMachineImpl();
46         BreakpointEventImpl event = new BreakpointEventImpl(vmImpl, requestID);
47         event.readThreadAndLocation(target,dataInStream);
48         ((ThreadReferenceImpl)event.thread()).setIsAtBreakpoint();
49         return event;
50     }
51 }
52
Popular Tags