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:
Component For CORBA/Java and EJB components, allows you to define the list of classes that must be custom loaded in addition to the component implementation class.
Package Allows you to define a custom class list shared by all Java components that are installed in the package.
Web application Allows you to specify classes and JAR files that are not in the Web application’s WEB-INF/lib or WEB-INF/classes directories, but must be custom loaded for the Web application.
Application Allows you to define a custom class list shared by all components and Web applications that are installed in the J2EE Application.
Server Allows you to define a custom class list shared by all components, servlets, and Web applications running on the server.
Servlet For servlets that are not installed in a Web application, but are installed directly in a server, allows you define the list of classes that must be custom loaded in addition to the servlet implementation class.
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.
Minimize 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. |
![]() |