|
J avolution v5.5 (J2SE 1.6+) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavolution.lang.ClassInitializer
public class ClassInitializer
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.
}
...
}
Method Summary | |
---|---|
static void |
initialize(java.lang.Class cls)
Initializes the specified class. |
static void |
initialize(java.lang.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(java.lang.String dirName)
Initializes all the classes in the specified directory. |
static void |
initializeJar(java.lang.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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void initializeAll()
initializeRuntime()
,
initializeClassPath()
public static void initializeRuntime()
System.getProperty("sun.boot.class.path"))
and the
extension .jar
in lib/ext
directory).
public static void initializeClassPath()
public static void initialize(java.lang.Class cls)
cls
- the class to initialize.public static void initialize(java.lang.String className)
className
- the name of the class to initialize.public static void initializeJar(java.lang.String jarName)
jarName
- the jar filename.public static void initializeDir(java.lang.String dirName)
dirName
- the name of the directory containing the classes to
initialize.
|
J avolution v5.5 (J2SE 1.6+) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |