javolution.lang
Class ClassInitializer

Object
  extended by ClassInitializer

public class ClassInitializer
extends Object

This utility class allows for initialization of all classes at startup to avoid initialization delays at an innapropriate time.

Note: Users might want to disable logging when initializing run-time classes at start-up because of the presence of old classes (never used) in the jar files for which initialization fails. For example:

     public static main(String[] args) {
         LogContext.enter(LogContext.NULL); // Temporarely disables logging errors and warnings.
         try { 
             ClassInitializer.initializeAll();  // Initializes bootstrap, extensions and classpath classes.
         } finally {
             LogContext.exit(LogContext.NULL); // Goes back to default logging.
         }
         ...
     }

Version:
5.5, April 21, 2010
Author:
Jean-Marie Dautelle

Method Summary
static void initialize(Class cls)
          Initializes the specified class.
static void initialize(String className)
          Initializes the class with the specified name.
static void initializeAll()
          Initializes all runtime and classpath classes.
static void initializeClassPath()
          Initializes all classes in current classpath.
static void initializeDir(String dirName)
          Initializes all the classes in the specified directory.
static void initializeJar(String jarName)
          Initializes all the classes in the specified jar file.
static void initializeRuntime()
          Initializes runtime classes (bootstrap classes in System.getProperty("sun.boot.class.path")) and the extension .jar in lib/ext directory).
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

initializeAll

public static void initializeAll()
Initializes all runtime and classpath classes.

See Also:
initializeRuntime(), initializeClassPath()

initializeRuntime

public static void initializeRuntime()
Initializes runtime classes (bootstrap classes in System.getProperty("sun.boot.class.path")) and the extension .jar in lib/ext directory).


initializeClassPath

public static void initializeClassPath()
Initializes all classes in current classpath.


initialize

public static void initialize(Class cls)
Initializes the specified class.

Parameters:
cls - the class to initialize.

initialize

public static void initialize(String className)
Initializes the class with the specified name.

Parameters:
className - the name of the class to initialize.

initializeJar

public static void initializeJar(String jarName)
Initializes all the classes in the specified jar file.

Parameters:
jarName - the jar filename.

initializeDir

public static void initializeDir(String dirName)
Initializes all the classes in the specified directory.

Parameters:
dirName - the name of the directory containing the classes to initialize.


Copyright © 2005-2012 Javolution. All Rights Reserved.