KickJava   Java API By Example, From Geeks To Geeks.

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


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.ReferenceTypeImpl;
19 import org.eclipse.jdi.internal.ThreadReferenceImpl;
20 import org.eclipse.jdi.internal.VirtualMachineImpl;
21 import org.eclipse.jdi.internal.request.RequestID;
22
23 import com.sun.jdi.ReferenceType;
24 import com.sun.jdi.event.ClassPrepareEvent;
25
26 /**
27  * this class implements the corresponding interfaces
28  * declared by the JDI specification. See the com.sun.jdi package
29  * for more information.
30  *
31  */

32 public class ClassPrepareEventImpl extends EventImpl implements ClassPrepareEvent {
33     /** Jdwp Event Kind. */
34     public static final byte EVENT_KIND = EVENT_CLASS_PREPARE;
35
36     /** Reference type for which this event was generated. */
37     private ReferenceTypeImpl fReferenceType;
38     
39     /**
40      * Creates new BreakpointEventImpl.
41      */

42     private ClassPrepareEventImpl(VirtualMachineImpl vmImpl, 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, RequestID requestID, DataInputStream JavaDoc dataInStream) throws IOException JavaDoc {
50         VirtualMachineImpl vmImpl = target.virtualMachineImpl();
51         ClassPrepareEventImpl event = new ClassPrepareEventImpl(vmImpl, requestID);
52         event.fThreadRef = ThreadReferenceImpl.read(target, dataInStream);
53         event.fReferenceType = ReferenceTypeImpl.readWithTypeTagAndSignature(target, false, dataInStream);
54         target.readInt("class status", ReferenceTypeImpl.classStatusStrings(), dataInStream); //$NON-NLS-1$
55
return event;
56     }
57     
58     /**
59      * @return Returns the reference type for which this event was generated.
60      */

61     public ReferenceType referenceType() {
62         return fReferenceType;
63     }
64     
65     /**
66      * @return Returns the JNI-style signature of the class that has been unloaded.
67      */

68     public String JavaDoc classSignature() {
69         return referenceType().signature();
70     }
71 }
72
Popular Tags