The Capsule class has a static method that is called in the static initializer of a capsule, i.e.:
final private static byte[] MID = findMID("ants.DataCapsule");
This looks up the name in a table and finds the method id associated
with that name. Since these names are now local to one particular
InChannel, we must make sure that we consult the table of the InChannel
whose class loader loaded this class. To be more exact, since the
static initializers are executed in the course of the class loader's
defineClass method, it must consult the table of the InChannel that
is currently loading that class. Unfortunately, there is no way in
Java to identify the current class loader in a static method: in a
non-static method, getClass().getClassLoader() could be used.
To circumvent this problem, we simply map the current thread to its
InChannel, and maintain initializers tables per InChannel. We assume
that the same thread that call defineClass will also execute the static
initializers of the class being defined.