1 /* 2 * Copyright (c) 2016, 2017, 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; 27 28 import com.sun.jdi.event.EventQueue; 29 import com.sun.jdi.event.VMDisconnectEvent; 30 31 /** 32 * A module in the target VM. 33 * <p> 34 * Any method on {@code ModuleReference} which directly or indirectly takes 35 * {@code ModuleReference} as a parameter may throw {@link VMDisconnectedException} 36 * if the target VM is disconnected and the {@link VMDisconnectEvent} has been or is 37 * available to be read from the {@link EventQueue}. 38 * <p> 39 * Any method on {@code ModuleReference} which directly or indirectly takes 40 * {@code ModuleReference} as a parameter may throw {@link VMOutOfMemoryException} 41 * if the target VM has run out of memory. 42 * <p> 43 * Any method on {@code ModuleReference} or which directly or indirectly takes 44 * {@code ModuleReference} as a parameter may throw {@link InvalidModuleException} 45 * if the mirrored module has been unloaded. 46 * 47 * Not all target virtual machines support this class. 48 * Use {@link VirtualMachine#canGetModuleInfo()} 49 * to determine if the class is supported. 50 * 51 * @since 9 52 */ 53 public interface ModuleReference extends ObjectReference { 54 55 /** 56 * Returns the module name. 57 * This method returns {@code null} 58 * if this module is an unnamed module. 59 * 60 * @return the name of this module. 61 */ name()62 String name(); 63 64 /** 65 * Returns the {@link ClassLoaderReference} object for this module. 66 * 67 * @return the {@link ClassLoaderReference} object for this module. 68 */ classLoader()69 ClassLoaderReference classLoader(); 70 } 71