Chapter 8: Understanding Tomcats Class Loaders

Overview

Tomcat is intrinsically linked with the Java programming language; it’s written in Java, and Java applications run on it. As such, it’s governed by the rules and attributes of the Java specification, two of which are platform independence and suitability for distributed network architectures.

To fulfill both these goals, Java employs many innovative techniques, one of which is how it loads code libraries. If Java is to be platform independent, it can’t rely on a specific type, or types, of file system. In addition, Java is designed to load code libraries from sources spread across a network, so it can’t just load them from a single file system.

The Java architects introduced class loaders to deal with these issues. A class loader abstracts the process of loading classes, making the process completely independent of any type of underlying data store, be it a network or a hard drive. Notice the similarity to the JNDI and JDBC APIs discussed in Chapter 7. These APIs also abstract the details of the underlying system and allow Java to be independent of any type of underlying naming service or database.

Tomcat and its Web applications use class loaders just as any other Java application does. However, as a servlet/JSP container Tomcat must provide class loaders to its Web applications. You’ve already read a quick discussion of this in Chapter 3 where you saw the locations for Tomcat’s class loaders. This chapter will expand on that discussion to give you a fuller picture of Tomcat and of class loaders, starting at the bottom with J2SE class loaders.



Pro Jakarta Tomcat 5
Pro Apache Tomcat 5/5.5 (Experts Voice in Java)
ISBN: 1590593316
EAN: 2147483647
Year: 2004
Pages: 94

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net