A.1. NamespacesThe JVM recognizes a class by its runtime identitythe class' full name (the package plus class name), along with the instance of the ClassLoader that instantiated the class. Each ClassLoader has its own namespace consisting of the classes it loads, and each fully qualified class name MUST be unique within that namespace. This naming convention is required by the J2EE specification. Two ClassLoaders could each load the same class, and the JVM would treat each class as a distinct type. Thus the JVM considers class com.jbossatwork.util.TextEmail in ClassLoader 1 different from the com.jbossatwork.util.TextEmail in ClassLoader 2 because they have different runtime identities based on the ClassLoader name. We'll see why this distinction is important when we get to the section on the JBoss ClassLoaders. |