Mirror Cache tab component properties  The system class loader


Chapter 30: Configuring Custom Java Class Lists


Understanding how the class loader works

In Java, a class loader loads the Java classes used by an application. Most applications use the Java system class loader, which loads classes from the directories and JAR files specified by the CLASSPATH environment variable. In the normal Java program configuration, you must restart a program or server to begin using updated Java classes. EAServer uses customized Java class loaders to allow hot refresh of Web application classes and Java components without restarting the server. EAServer provides custom class loaders for these entity types:

Each server, component, Web application, application, and package has a custom class loader associated with it. The EAServer class loaders have a a parent-child hierarchy. Every class loader except the server class loader has a parent. This relationship is shown in the following figure:

Figure 30-1: EAServer class loader hierarchy

The package, application, and server custom class lists allow you to configure sharing of common utility classes used by components and Web applications. By custom loading these classes at a higher level, you avoid the overhead incurred by custom-loading many copies of the same class.

When you specify the same class at multiple levels, it is always loaded at the highest possible level. For example, if you specify Java package X in a component’s class list, the class list of the package where X is installed, and the class list of the server where the package is installed, the server class loader loads classes in package X.

NoteMinimize Refresh in production servers Refreshing components loads additional copies of all implementation classes. EAServer leaves the previous implementation in memory for use by existing client sessions. In effect, refresh introduces a controlled memory leak. For this reason, it is best to restart your production server after deploying a large number of new implementation classes.





Copyright © 2003. Sybase Inc. All rights reserved. The system class loader

View this book as PDF