JBoss ClassLoader Introduction
This article is about the new classloader implementation and additional abstractions that use it from JBoss5.JBoss ClassLoader History are not covered by this document.
The JBoss ClassLoader framework is made up of a number of abstractions at different levels.The purpose of this introduction is give a high level overview of what each part of the framework does. The different abstractions exist to accomplish one of the goals of the JBoss ClassLoader project which is to allow different users to consume only the parts they want.
JBoss ClassLoader Implementation
The JBoss ClassLoader project is the runtime implementation of the classloader framework. If you just want the basic functionality of the classloader then you can use this level directly. Here you can create ClassLoaderPolicys that define each classloader's rules and link them together to create a peer delegate classloading system. Since this is the runtime model, it is this level that the optional JMX management exists.
The JBoss ClassLoading project is the deployment time framework that allows classloaders to be constructed from ClassLoadingMetaData. Rather than dealing with constructing policies and manually linking them together, you specify requirements and capabilities for each ClassLoading Module. The system then links these requirements to capabilities as they are satisifed and checks their consistency. You can think of this level as a kind of dependency injection framework for classloaders. As this is the deployment time model, it this level that can expose the "managed object" view to the JBoss profile service and management console.
JBoss ClassLoading - VFS
There is a seperate option that allows you to construct your modules insideJBossMicrocontainer configuration. This can be seen in use in the bootstrap configuration files of JBoss5.
Built on top of these layers are the ClassLoading Deployers which allow for easy construction of classloaders from JavaEE deployments (or any other type of deployment). This includes mapping of legacy configuration to the ClassLoadingMetaData.
Additionally there is a MockClassLoaderPolicy which some may find useful to test or implement classloading scenarios in unit tests.