1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
<?xml version="1.0"?>
<document>
<properties>
<title>classworlds</title>
<author email="bob@werken.com">bob mcwhirter</author>
</properties>
<body>
<section name="Overview">
<p>
<code>classworlds</code> is a framework for container developers
who require complex manipulation of Java's ClassLoaders. Java's
native <code>ClassLoader</code> mechanims and classes can cause
much headache and confusion for certain types of application
developers. Projects which involve dynamic loading of components
or otherwise represent a 'container' can benefit from the classloading
control provided by <code>classworlds</code>.
</p>
<p>
<code>classworlds</code> provides a richer set of semantics for
class loading than Java's normal mechanisms, while still being
able to provide a <code>ClassLoader</code> interface to integrate
seamlessly with the Java environment.
</p>
<p>
The <code>classworlds</code> model does away with the hierarchy
normally associated with ClassLoaders. Instead, there is a
pool of <a href="apidocs/com/codehaus/classworlds/ClassRealm.html">ClassRealms</a>
which can import arbitrary packages from other ClassRealms.
Effectively, <code>classworlds</code> turns the old-style
hierarchy into a directed graph.
</p>
<p>
In a application container environment, the container may
have a realm capable of loading on the container/component
contract interfaces and classes. Another realm is created
for each component which imports the contract classes from
the container realm.
</p>
<p>
This model allows for fine-grained control of which
classloader loads any particular class. This form of
partial isolation can reduce the myriad strange errors
that are produced by loading classes from multiple
loaders.
</p>
</section>
</body>
</document>
|