src/share/classes/java/lang/System.java

Print this page




1207 
1208         // Subsystems that are invoked during initialization can invoke
1209         // sun.misc.VM.isBooted() in order to avoid doing things that should
1210         // wait until the application class loader has been set up.
1211         // IMPORTANT: Ensure that this remains the last initialization action!
1212         sun.misc.VM.booted();
1213     }
1214 
1215     private static void setJavaLangAccess() {
1216         // Allow privileged classes outside of java.lang
1217         sun.misc.SharedSecrets.setJavaLangAccess(new sun.misc.JavaLangAccess(){
1218             public sun.reflect.ConstantPool getConstantPool(Class<?> klass) {
1219                 return klass.getConstantPool();
1220             }
1221             public void setAnnotationType(Class<?> klass, AnnotationType type) {
1222                 klass.setAnnotationType(type);
1223             }
1224             public AnnotationType getAnnotationType(Class<?> klass) {
1225                 return klass.getAnnotationType();
1226             }



1227             public byte[] getRawClassTypeAnnotations(Class<?> klass) {
1228                 return klass.getRawTypeAnnotations();
1229             }
1230             public byte[] getRawExecutableTypeAnnotations(Executable executable) {
1231                 return Class.getExecutableTypeAnnotationBytes(executable);
1232             }
1233             public <E extends Enum<E>>
1234                     E[] getEnumConstantsShared(Class<E> klass) {
1235                 return klass.getEnumConstantsShared();
1236             }
1237             public void blockedOn(Thread t, Interruptible b) {
1238                 t.blockedOn(b);
1239             }
1240             public void registerShutdownHook(int slot, boolean registerShutdownInProgress, Runnable hook) {
1241                 Shutdown.add(slot, registerShutdownInProgress, hook);
1242             }
1243             public int getStackTraceDepth(Throwable t) {
1244                 return t.getStackTraceDepth();
1245             }
1246             public StackTraceElement getStackTraceElement(Throwable t, int i) {


1207 
1208         // Subsystems that are invoked during initialization can invoke
1209         // sun.misc.VM.isBooted() in order to avoid doing things that should
1210         // wait until the application class loader has been set up.
1211         // IMPORTANT: Ensure that this remains the last initialization action!
1212         sun.misc.VM.booted();
1213     }
1214 
1215     private static void setJavaLangAccess() {
1216         // Allow privileged classes outside of java.lang
1217         sun.misc.SharedSecrets.setJavaLangAccess(new sun.misc.JavaLangAccess(){
1218             public sun.reflect.ConstantPool getConstantPool(Class<?> klass) {
1219                 return klass.getConstantPool();
1220             }
1221             public void setAnnotationType(Class<?> klass, AnnotationType type) {
1222                 klass.setAnnotationType(type);
1223             }
1224             public AnnotationType getAnnotationType(Class<?> klass) {
1225                 return klass.getAnnotationType();
1226             }
1227             public byte[] getRawClassAnnotations(Class<?> klass) {
1228                 return klass.getRawAnnotations();
1229             }
1230             public byte[] getRawClassTypeAnnotations(Class<?> klass) {
1231                 return klass.getRawTypeAnnotations();
1232             }
1233             public byte[] getRawExecutableTypeAnnotations(Executable executable) {
1234                 return Class.getExecutableTypeAnnotationBytes(executable);
1235             }
1236             public <E extends Enum<E>>
1237                     E[] getEnumConstantsShared(Class<E> klass) {
1238                 return klass.getEnumConstantsShared();
1239             }
1240             public void blockedOn(Thread t, Interruptible b) {
1241                 t.blockedOn(b);
1242             }
1243             public void registerShutdownHook(int slot, boolean registerShutdownInProgress, Runnable hook) {
1244                 Shutdown.add(slot, registerShutdownInProgress, hook);
1245             }
1246             public int getStackTraceDepth(Throwable t) {
1247                 return t.getStackTraceDepth();
1248             }
1249             public StackTraceElement getStackTraceElement(Throwable t, int i) {