public class Initializer extends Object
An initializer for all classes loaded by any given class loader.
Initialization of classes at startup (or during bundle activation)
ensures a significantly improved worst case execution time especially
if the classes has
configuration logic to be
Javolution activator initialize
Realtime classes when started.
When running outside OSGi the method
can be used to that effect..
Class loading can be performed in a lazy manner and therefore some parts of the class loading process may be done on first use rather than at load time. Javolution bundle activator ensure that all its classes are initialized at start up. The following code illustrates how this can be done for any bundle.
This utility use reflection to find the classes loaded and may not be supported on all platforms.
|Modifier and Type||Field and Description|
Indicates if the class being initialized should be logged (default
|Constructor and Description|
Creates an initializer for the specified class loader.
|Modifier and Type||Method and Description|
Initializes all the loaded classes.
Loads the specified class (does not perform any initialization).
Returns the classes loaded by the class loader of this initializer or
public Initializer(ClassLoader classLoader)
public Class<?> loadedClasses()
nullif not supported by the platform.
public void loadClass(Class<?> cls)
public boolean initializeLoadedClasses()
trueif initialization has been performed successfully;
Copyright © 2005-2013 Javolution. All Rights Reserved.