KickJava   Java API By Example, From Geeks To Geeks.

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


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.TypeImpl;
19 import org.eclipse.jdi.internal.VirtualMachineImpl;
20 import org.eclipse.jdi.internal.request.RequestID;
21
22 import com.sun.jdi.event.ClassUnloadEvent;
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 ClassUnloadEventImpl extends EventImpl implements ClassUnloadEvent {
31     /** Jdwp Event Kind. */
32     public static final byte EVENT_KIND = EVENT_CLASS_UNLOAD;
33
34     /** Type signature. */
35     private String JavaDoc fSignature;
36
37     /**
38      * Creates new ClassUnloadEventImpl.
39      */

40     private ClassUnloadEventImpl(VirtualMachineImpl vmImpl, RequestID requestID) {
41         super("ClassUnloadEvent", vmImpl, requestID); //$NON-NLS-1$
42
}
43
44     /**
45      * @return Creates, reads and returns new EventImpl, of which requestID has already been read.
46      */

47     public static ClassUnloadEventImpl read(MirrorImpl target, RequestID requestID, DataInputStream JavaDoc dataInStream) throws IOException JavaDoc {
48         VirtualMachineImpl vmImpl = target.virtualMachineImpl();
49         ClassUnloadEventImpl event = new ClassUnloadEventImpl(vmImpl, requestID);
50         event.fSignature = target.readString("signature", dataInStream); //$NON-NLS-1$
51
// Remove the class from classes that are known by the application to be loaded in the VM.
52
vmImpl.removeKnownRefType(event.fSignature);
53         return event;
54     }
55
56     /**
57      * @return Returns the name of the class that has been unloaded.
58      */

59     public String JavaDoc className() {
60         return TypeImpl.signatureToName(fSignature);
61     }
62     
63     /**
64      * @return Returns the JNI-style signature of the class that has been unloaded.
65      */

66     public String JavaDoc classSignature() {
67         return fSignature;
68     }
69 }
70
Popular Tags