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.jdi.internal.event;
11:
12: import java.io.DataInputStream;
13: import java.io.IOException;
14:
15: import org.eclipse.jdi.internal.LocationImpl;
16: import org.eclipse.jdi.internal.MirrorImpl;
17: import org.eclipse.jdi.internal.ThreadReferenceImpl;
18: import org.eclipse.jdi.internal.VirtualMachineImpl;
19: import org.eclipse.jdi.internal.request.RequestID;
20:
21: import com.sun.jdi.Locatable;
22: import com.sun.jdi.Location;
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 abstract class LocatableEventImpl extends EventImpl implements
31: Locatable {
32: /** Location where event occurred. */
33: protected LocationImpl fLocation;
34:
35: /**
36: * Creates new LocatableEventImpl, only used by subclasses.
37: */
38: protected LocatableEventImpl(String description,
39: VirtualMachineImpl vmImpl, RequestID requestID) {
40: super (description, vmImpl, requestID);
41: }
42:
43: /**
44: * Reads Thread and Location.
45: */
46: public void readThreadAndLocation(MirrorImpl target,
47: DataInputStream dataInStream) throws IOException {
48: fThreadRef = ThreadReferenceImpl.read(target, dataInStream);
49: fLocation = LocationImpl.read(target, dataInStream);
50: }
51:
52: /**
53: * @return Returns Location where event occurred.
54: */
55: public Location location() {
56: return fLocation;
57: }
58: }
|