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 jdk.internal.access;
27
28 import java.lang.annotation.Annotation;
29 import java.lang.module.ModuleDescriptor;
30 import java.lang.reflect.Executable;
31 import java.lang.reflect.Method;
32 import java.net.URI;
33 import java.nio.charset.CharacterCodingException;
34 import java.nio.charset.Charset;
35 import java.security.AccessControlContext;
36 import java.security.ProtectionDomain;
37 import java.util.Iterator;
38 import java.util.List;
39 import java.util.Map;
40 import java.util.concurrent.ConcurrentHashMap;
41 import java.util.stream.Stream;
42
43 import jdk.internal.module.ServicesCatalog;
44 import jdk.internal.reflect.ConstantPool;
45 import sun.reflect.annotation.AnnotationType;
46 import sun.nio.ch.Interruptible;
47
48 public interface JavaLangAccess {
49
50 /**
51 * Returns the list of {@code Method} objects for the declared public
52 * methods of this class or interface that have the specified method name
53 * and parameter types.
54 */
55 List<Method> getDeclaredPublicMethods(Class<?> klass, String name, Class<?>... parameterTypes);
56
57 /**
58 * Return the constant pool for a class.
59 */
204 */
205 void addExports(Module m1, String pkg, Module m2);
206
207 /**
208 * Updates a module m to export a package to all unnamed modules.
209 */
210 void addExportsToAllUnnamed(Module m, String pkg);
211
212 /**
213 * Updates module m1 to open a package to module m2. Opening the
214 * package does not result in a strong reference to m2 (m2 can be GC'ed).
215 */
216 void addOpens(Module m1, String pkg, Module m2);
217
218 /**
219 * Updates module m to open a package to all unnamed modules.
220 */
221 void addOpensToAllUnnamed(Module m, String pkg);
222
223 /**
224 * Updates module m to open all packages returned by the given iterator.
225 */
226 void addOpensToAllUnnamed(Module m, Iterator<String> packages);
227
228 /**
229 * Updates module m to use a service.
230 */
231 void addUses(Module m, Class<?> service);
232
233 /**
234 * Returns true if module m reflectively exports a package to other
235 */
236 boolean isReflectivelyExported(Module module, String pn, Module other);
237
238 /**
239 * Returns true if module m reflectively opens a package to other
240 */
241 boolean isReflectivelyOpened(Module module, String pn, Module other);
242
243 /**
244 * Returns the ServicesCatalog for the given Layer.
245 */
246 ServicesCatalog getServicesCatalog(ModuleLayer layer);
|
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 jdk.internal.access;
27
28 import java.lang.annotation.Annotation;
29 import java.lang.module.ModuleDescriptor;
30 import java.lang.reflect.Executable;
31 import java.lang.reflect.Method;
32 import java.net.URI;
33 import java.nio.charset.CharacterCodingException;
34 import java.nio.charset.Charset;
35 import java.security.AccessControlContext;
36 import java.security.ProtectionDomain;
37 import java.util.Iterator;
38 import java.util.List;
39 import java.util.Map;
40 import java.util.Set;
41 import java.util.concurrent.ConcurrentHashMap;
42 import java.util.stream.Stream;
43
44 import jdk.internal.module.ServicesCatalog;
45 import jdk.internal.reflect.ConstantPool;
46 import sun.reflect.annotation.AnnotationType;
47 import sun.nio.ch.Interruptible;
48
49 public interface JavaLangAccess {
50
51 /**
52 * Returns the list of {@code Method} objects for the declared public
53 * methods of this class or interface that have the specified method name
54 * and parameter types.
55 */
56 List<Method> getDeclaredPublicMethods(Class<?> klass, String name, Class<?>... parameterTypes);
57
58 /**
59 * Return the constant pool for a class.
60 */
205 */
206 void addExports(Module m1, String pkg, Module m2);
207
208 /**
209 * Updates a module m to export a package to all unnamed modules.
210 */
211 void addExportsToAllUnnamed(Module m, String pkg);
212
213 /**
214 * Updates module m1 to open a package to module m2. Opening the
215 * package does not result in a strong reference to m2 (m2 can be GC'ed).
216 */
217 void addOpens(Module m1, String pkg, Module m2);
218
219 /**
220 * Updates module m to open a package to all unnamed modules.
221 */
222 void addOpensToAllUnnamed(Module m, String pkg);
223
224 /**
225 * Updates module m to open all packages in the given sets.
226 */
227 void addOpensToAllUnnamed(Module m, Set<String> concealedPkgs, Set<String> exportedPkgs);
228
229 /**
230 * Updates module m to use a service.
231 */
232 void addUses(Module m, Class<?> service);
233
234 /**
235 * Returns true if module m reflectively exports a package to other
236 */
237 boolean isReflectivelyExported(Module module, String pn, Module other);
238
239 /**
240 * Returns true if module m reflectively opens a package to other
241 */
242 boolean isReflectivelyOpened(Module module, String pn, Module other);
243
244 /**
245 * Returns the ServicesCatalog for the given Layer.
246 */
247 ServicesCatalog getServicesCatalog(ModuleLayer layer);
|