< prev index next >

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

Print this page




1902         // is incremented from 0 to 1 here to indicate the first phase of
1903         // initialization has completed.
1904         // IMPORTANT: Ensure that this remains the last initialization action!
1905         VM.initLevel(1);
1906     }
1907 
1908     // @see #initPhase2()
1909     private static Layer bootLayer;
1910 
1911     /*
1912      * Invoked by VM.  Phase 2 module system initialization.
1913      * Only classes in java.base can be loaded in this phase.
1914      */
1915     private static void initPhase2() {
1916         // initialize the module system
1917         System.bootLayer = ModuleBootstrap.boot();
1918 
1919         // base module needs to be loose
1920         Module base = Object.class.getModule();
1921         if (base == null)
1922             throw new InternalError();
1923         Modules.addReads(base, null);
1924 
1925         // module system initialized
1926         VM.initLevel(2);
1927     }
1928 
1929     /*
1930      * Invoked by VM.  Phase 3 is the final system initialization:
1931      * 1. set security manager
1932      * 2. set system class loader
1933      * 3. set TCCL
1934      *
1935      * This method must be called after the module system initialization.
1936      * The security manager and system class loader may be custom class from
1937      * the application classpath or modulepath.
1938      */
1939     private static void initPhase3() {
1940         // set security manager
1941         String cn = System.getProperty("java.security.manager");
1942         if (cn != null) {




1902         // is incremented from 0 to 1 here to indicate the first phase of
1903         // initialization has completed.
1904         // IMPORTANT: Ensure that this remains the last initialization action!
1905         VM.initLevel(1);
1906     }
1907 
1908     // @see #initPhase2()
1909     private static Layer bootLayer;
1910 
1911     /*
1912      * Invoked by VM.  Phase 2 module system initialization.
1913      * Only classes in java.base can be loaded in this phase.
1914      */
1915     private static void initPhase2() {
1916         // initialize the module system
1917         System.bootLayer = ModuleBootstrap.boot();
1918 
1919         // base module needs to be loose
1920         Module base = Object.class.getModule();
1921         if (base == null)
1922             throw new InternalError("base module is null");
1923         Modules.addReads(base, null);
1924 
1925         // module system initialized
1926         VM.initLevel(2);
1927     }
1928 
1929     /*
1930      * Invoked by VM.  Phase 3 is the final system initialization:
1931      * 1. set security manager
1932      * 2. set system class loader
1933      * 3. set TCCL
1934      *
1935      * This method must be called after the module system initialization.
1936      * The security manager and system class loader may be custom class from
1937      * the application classpath or modulepath.
1938      */
1939     private static void initPhase3() {
1940         // set security manager
1941         String cn = System.getProperty("java.security.manager");
1942         if (cn != null) {


< prev index next >