27 |
27 |
28 import java.io.IOException; |
28 import java.io.IOException; |
29 import java.lang.annotation.Annotation; |
29 import java.lang.annotation.Annotation; |
30 import java.lang.reflect.Executable; |
30 import java.lang.reflect.Executable; |
31 import java.lang.reflect.Layer; |
31 import java.lang.reflect.Layer; |
|
32 import java.lang.reflect.Method; |
32 import java.lang.reflect.Module; |
33 import java.lang.reflect.Module; |
33 import java.net.URL; |
34 import java.net.URL; |
34 import java.security.AccessControlContext; |
35 import java.security.AccessControlContext; |
35 import java.util.Map; |
36 import java.util.Map; |
36 import java.util.concurrent.ConcurrentHashMap; |
37 import java.util.concurrent.ConcurrentHashMap; |
37 import java.util.stream.Stream; |
38 import java.util.stream.Stream; |
38 |
39 |
39 import jdk.internal.module.ServicesCatalog; |
|
40 import jdk.internal.reflect.ConstantPool; |
40 import jdk.internal.reflect.ConstantPool; |
41 import sun.reflect.annotation.AnnotationType; |
41 import sun.reflect.annotation.AnnotationType; |
42 import sun.nio.ch.Interruptible; |
42 import sun.nio.ch.Interruptible; |
43 |
43 |
44 public interface JavaLangAccess { |
44 public interface JavaLangAccess { |
|
45 |
|
46 /** |
|
47 * Returns a {@code Method} object that reflects the specified public |
|
48 * member method of the given class. Returns {@code null} if the |
|
49 * method is not defined. |
|
50 */ |
|
51 Method getMethodOrNull(Class<?> klass, String name, Class<?>... parameterTypes); |
|
52 |
45 /** Return the constant pool for a class. */ |
53 /** Return the constant pool for a class. */ |
46 ConstantPool getConstantPool(Class<?> klass); |
54 ConstantPool getConstantPool(Class<?> klass); |
47 |
55 |
48 /** |
56 /** |
49 * Compare-And-Swap the AnnotationType instance corresponding to this class. |
57 * Compare-And-Swap the AnnotationType instance corresponding to this class. |
134 * Returns the boot Layer |
142 * Returns the boot Layer |
135 */ |
143 */ |
136 Layer getBootLayer(); |
144 Layer getBootLayer(); |
137 |
145 |
138 /** |
146 /** |
139 * Returns the ServicesCatalog for the given class loader. |
|
140 */ |
|
141 ServicesCatalog getServicesCatalog(ClassLoader cl); |
|
142 |
|
143 /** |
|
144 * Returns the ServicesCatalog for the given class loader, creating it |
|
145 * if doesn't already exist. |
|
146 */ |
|
147 ServicesCatalog createOrGetServicesCatalog(ClassLoader cl); |
|
148 |
|
149 /** |
|
150 * Returns the ConcurrentHashMap used as a storage for ClassLoaderValue(s) |
147 * Returns the ConcurrentHashMap used as a storage for ClassLoaderValue(s) |
151 * associated with the given class loader, creating it if it doesn't already exist. |
148 * associated with the given class loader, creating it if it doesn't already exist. |
152 */ |
149 */ |
153 ConcurrentHashMap<?, ?> createOrGetClassLoaderValueMap(ClassLoader cl); |
150 ConcurrentHashMap<?, ?> createOrGetClassLoaderValueMap(ClassLoader cl); |
154 |
151 |