1 /*
2  * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * This code is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License version 2 only, as
7  * published by the Free Software Foundation.  Oracle designates this
8  * particular file as subject to the "Classpath" exception as provided
9  * by Oracle in the LICENSE file that accompanied this code.
10  *
11  * This code is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14  * version 2 for more details (a copy is included in the LICENSE file that
15  * accompanied this code).
16  *
17  * You should have received a copy of the GNU General Public License version
18  * 2 along with this work; if not, write to the Free Software Foundation,
19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20  *
21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22  * or visit www.oracle.com if you need additional information or have any
23  * questions.
24  */
25 
26 package com.sun.jdi.event;
27 
28 import com.sun.jdi.*;
29 
30 /**
31  * Notification of a class prepare in the target VM. See the JVM
32  * specification for a definition of class preparation. Class prepare
33  * events are not generated for primtiive classes (for example,
34  * java.lang.Integer.TYPE).
35  *
36  * @see EventQueue
37  * @see VirtualMachine
38  *
39  * @author Robert Field
40  * @since  1.3
41  */
42 @jdk.Exported
43 public interface ClassPrepareEvent extends Event {
44     /**
45      * Returns the thread in which this event has occurred.
46      * <p>
47      * In rare cases, this event may occur in a debugger system
48      * thread within the target VM. Debugger threads take precautions
49      * to prevent these events, but they cannot be avoided under some
50      * conditions, especially for some subclasses of
51      * {@link java.lang.Error}.
52      * If the event was generated by a debugger system thread, the
53      * value returned by this method is null, and if the requested
54      * suspend policy for the event was
55      * {@link com.sun.jdi.request.EventRequest#SUSPEND_EVENT_THREAD},
56      * all threads will be suspended instead, and the
57      * {@link EventSet#suspendPolicy} will reflect this change.
58      * <p>
59      * Note that the discussion above does not apply to system threads
60      * created by the target VM during its normal (non-debug) operation.
61      *
62      * @return a {@link ThreadReference} which mirrors the event's thread in
63      * the target VM, or null in the rare cases described above.
64      */
thread()65     public ThreadReference thread();
66 
67     /**
68      * Returns the reference type for which this event was generated.
69      *
70      * @return a {@link ReferenceType} which mirrors the class, interface, or
71      * array which has been linked.
72      */
referenceType()73     public ReferenceType referenceType();
74 }
75