Summary

In this chapter you learned how class loaders abstract the process of loading class files before the first instantiation and make them available for use. Java’s class loaders support loading classes from the local file system to the network and also give developers the facility to create their own custom class loaders. The three basic class loaders are the bootstrap, extension, and system class loaders.

Class loaders use the delegation model where every class loader passes the request to its parent until the bootstrap class loader is reached, and then each class loader looks for the class; if it can’t find it, it goes back down the chain. Implementing the delegation model is optional, but class loaders can’t function if they don’t delegate to the bootstrap class loader at some point. Also, some advantages exist of having a unique namespace for each class loader.

The Java security model prevents the misuse of custom class loaders by allowing only the bootstrap class loader to load classes that start with java.*. Also, by using the security manager, an application can forbid the use of custom class loaders.

Lastly you saw that Tomcat has four class loaders: common, server, shared, and Web application. To share classes with all Web applications, users should use the shared class loader.



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