< prev index next >

src/java.base/share/classes/jdk/internal/access/SharedSecrets.java

Print this page

 34 import java.util.ResourceBundle;
 35 import java.util.jar.JarFile;
 36 import java.io.Console;
 37 import java.io.FileDescriptor;
 38 import java.io.FilePermission;
 39 import java.io.ObjectInputStream;
 40 import java.io.RandomAccessFile;
 41 import java.security.ProtectionDomain;
 42 import java.security.Signature;
 43 
 44 /** A repository of "shared secrets", which are a mechanism for
 45     calling implementation-private methods in another package without
 46     using reflection. A package-private class implements a public
 47     interface and provides the ability to call package-private methods
 48     within that package; the object implementing that interface is
 49     provided through a third package to which access is restricted.
 50     This framework avoids the primary disadvantage of using reflection
 51     for this purpose, namely the loss of compile-time checking. */
 52 
 53 public class SharedSecrets {
 54     private static final MethodHandles.Lookup lookup = MethodHandles.lookup();
 55     private static JavaAWTAccess javaAWTAccess;
 56     private static JavaAWTFontAccess javaAWTFontAccess;
 57     private static JavaBeansAccess javaBeansAccess;
 58     private static JavaLangAccess javaLangAccess;
 59     private static JavaLangInvokeAccess javaLangInvokeAccess;
 60     private static JavaLangModuleAccess javaLangModuleAccess;
 61     private static JavaLangRefAccess javaLangRefAccess;
 62     private static JavaLangReflectAccess javaLangReflectAccess;
 63     private static JavaIOAccess javaIOAccess;
 64     private static JavaIOFileDescriptorAccess javaIOFileDescriptorAccess;
 65     private static JavaIOFilePermissionAccess javaIOFilePermissionAccess;
 66     private static JavaIORandomAccessFileAccess javaIORandomAccessFileAccess;
 67     private static JavaObjectInputStreamReadString javaObjectInputStreamReadString;
 68     private static JavaObjectInputStreamAccess javaObjectInputStreamAccess;
 69     private static JavaObjectInputFilterAccess javaObjectInputFilterAccess;
 70     private static JavaNetInetAddressAccess javaNetInetAddressAccess;
 71     private static JavaNetHttpCookieAccess javaNetHttpCookieAccess;
 72     private static JavaNetUriAccess javaNetUriAccess;
 73     private static JavaNetURLAccess javaNetURLAccess;
 74     private static JavaNioAccess javaNioAccess;

 34 import java.util.ResourceBundle;
 35 import java.util.jar.JarFile;
 36 import java.io.Console;
 37 import java.io.FileDescriptor;
 38 import java.io.FilePermission;
 39 import java.io.ObjectInputStream;
 40 import java.io.RandomAccessFile;
 41 import java.security.ProtectionDomain;
 42 import java.security.Signature;
 43 
 44 /** A repository of "shared secrets", which are a mechanism for
 45     calling implementation-private methods in another package without
 46     using reflection. A package-private class implements a public
 47     interface and provides the ability to call package-private methods
 48     within that package; the object implementing that interface is
 49     provided through a third package to which access is restricted.
 50     This framework avoids the primary disadvantage of using reflection
 51     for this purpose, namely the loss of compile-time checking. */
 52 
 53 public class SharedSecrets {

 54     private static JavaAWTAccess javaAWTAccess;
 55     private static JavaAWTFontAccess javaAWTFontAccess;
 56     private static JavaBeansAccess javaBeansAccess;
 57     private static JavaLangAccess javaLangAccess;
 58     private static JavaLangInvokeAccess javaLangInvokeAccess;
 59     private static JavaLangModuleAccess javaLangModuleAccess;
 60     private static JavaLangRefAccess javaLangRefAccess;
 61     private static JavaLangReflectAccess javaLangReflectAccess;
 62     private static JavaIOAccess javaIOAccess;
 63     private static JavaIOFileDescriptorAccess javaIOFileDescriptorAccess;
 64     private static JavaIOFilePermissionAccess javaIOFilePermissionAccess;
 65     private static JavaIORandomAccessFileAccess javaIORandomAccessFileAccess;
 66     private static JavaObjectInputStreamReadString javaObjectInputStreamReadString;
 67     private static JavaObjectInputStreamAccess javaObjectInputStreamAccess;
 68     private static JavaObjectInputFilterAccess javaObjectInputFilterAccess;
 69     private static JavaNetInetAddressAccess javaNetInetAddressAccess;
 70     private static JavaNetHttpCookieAccess javaNetHttpCookieAccess;
 71     private static JavaNetUriAccess javaNetUriAccess;
 72     private static JavaNetURLAccess javaNetURLAccess;
 73     private static JavaNioAccess javaNioAccess;
< prev index next >