Methods and apparatus, including computer program products, implement a hierarchical
arrangement of class loaders. Each class loader has a naming token, and each token
driven class loader has one or more delegation tokens. A class definition request
is received in a first, token driven class loader. If the first class loader has
a parent class loader, the class definition is requested from the parent. If the
parent is a token driven class loader, delegation tokens are used to delegate the
class definition request to the parent. If the class definition is not obtained
from a parent class loader, an attempt is made to obtain the class definition from
the resources of the first class loader. If that also fails, the delegation tokens
of the first class loader are used to find a matching child class loader and the
class definition is requested from the matching child class loader.