Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The components are libraries class loaders are defined in the JBI spec and contain the jars referenced in the jbi descriptor. These class
loaders can use a parent-first (default) or self-first delegation: when a class is loaded, the class loader will first ask its parent(s), or will first load the class from its referenced jars.

...

If you put this class in the container, you will need to restart the container after having added the jar in the classpath, which is not
what we want. So usually, we put it in the SU.

The other benefit of using classloaders is that you can have isolated components. You could deploy two components (or SU) which use
different version of the same library without any problems. This is not possible if you put all the dependencies in the container
classpath.

Self-first delegation.

The common delegation mechanism for classloaders is to delegate to the parent first when loading a class. Thus, all classes defined in the
container classloader are shared. But when a class reference another class (using an import statement in the java code for example), the
referenced classes will be loaded by the same classloader. To avoid such problems, you can use a self-first delegation: classes will be loaded from the classloader, and if not found, it will ask its parent.