Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/com/sun/jdi/ClassLoaderReference.java
38831 views
/*1* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package com.sun.jdi;2627import java.util.List;2829/**30* A class loader object from the target VM.31* A ClassLoaderReference is an {@link ObjectReference} with additional32* access to classloader-specific information from the target VM. Instances33* ClassLoaderReference are obtained through calls to34* {@link ReferenceType#classLoader}35*36* @see ObjectReference37*38* @author Gordon Hirsch39* @since 1.340*/41@jdk.Exported42public interface ClassLoaderReference extends ObjectReference {4344/**45* Returns a list of all loaded classes that were defined by this46* class loader. No ordering of this list guaranteed.47* <P>48* The returned list will include reference types49* loaded at least to the point of preparation and50* types (like array) for which preparation is51* not defined.52*53* @return a List of {@link ReferenceType} objects mirroring types54* loaded by this class loader. The list has length 0 if no types55* have been defined by this classloader.56*/57List<ReferenceType> definedClasses();5859/**60* Returns a list of all classes for which this class loader has61* been recorded as the initiating loader in the target VM.62* The list contains ReferenceTypes defined directly by this loader63* (as returned by {@link #definedClasses}) and any types for which64* loading was delegated by this class loader to another class loader.65* <p>66* The visible class list has useful properties with respect to67* the type namespace. A particular type name will occur at most68* once in the list. Each field or variable declared with that69* type name in a class defined by70* this class loader must be resolved to that single type.71* <p>72* No ordering of the returned list is guaranteed.73* <p>74* See75* <cite>The Java™ Virtual Machine Specification</cite>,76* section 5.3 - Creation and Loading77* for more information on the initiating classloader.78* <p>79* Note that unlike {@link #definedClasses()}80* and {@link VirtualMachine#allClasses()},81* some of the returned reference types may not be prepared.82* Attempts to perform some operations on unprepared reference types83* (e.g. {@link ReferenceType#fields() fields()}) will throw84* a {@link ClassNotPreparedException}.85* Use {@link ReferenceType#isPrepared()} to determine if86* a reference type is prepared.87*88* @return a List of {@link ReferenceType} objects mirroring classes89* initiated by this class loader. The list has length 0 if no classes90* are visible to this classloader.91*/92List<ReferenceType> visibleClasses();93}949596