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.MirrorImpl;
16: import org.eclipse.jdi.internal.ReferenceTypeImpl;
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.ReferenceType;
22: import com.sun.jdi.event.ClassPrepareEvent;
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 ClassPrepareEventImpl extends EventImpl implements
31: ClassPrepareEvent {
32: /** Jdwp Event Kind. */
33: public static final byte EVENT_KIND = EVENT_CLASS_PREPARE;
34:
35: /** Reference type for which this event was generated. */
36: private ReferenceTypeImpl fReferenceType;
37:
38: /**
39: * Creates new BreakpointEventImpl.
40: */
41: private ClassPrepareEventImpl(VirtualMachineImpl vmImpl,
42: RequestID requestID) {
43: super ("ClassPrepareEvent", vmImpl, requestID); //$NON-NLS-1$
44: }
45:
46: /**
47: * @return Creates, reads and returns new EventImpl, of which requestID has already been read.
48: */
49: public static ClassPrepareEventImpl read(MirrorImpl target,
50: RequestID requestID, DataInputStream dataInStream)
51: throws IOException {
52: VirtualMachineImpl vmImpl = target.virtualMachineImpl();
53: ClassPrepareEventImpl event = new ClassPrepareEventImpl(vmImpl,
54: requestID);
55: event.fThreadRef = ThreadReferenceImpl.read(target,
56: dataInStream);
57: event.fReferenceType = ReferenceTypeImpl
58: .readWithTypeTagAndSignature(target, false,
59: dataInStream);
60: target
61: .readInt(
62: "class status", ReferenceTypeImpl.classStatusStrings(), dataInStream); //$NON-NLS-1$
63: return event;
64: }
65:
66: /**
67: * @return Returns the reference type for which this event was generated.
68: */
69: public ReferenceType referenceType() {
70: return fReferenceType;
71: }
72:
73: /**
74: * @return Returns the JNI-style signature of the class that has been unloaded.
75: */
76: public String classSignature() {
77: return referenceType().signature();
78: }
79: }
|