Portal Classloader
The portal classloader organizes and provides the resources of the modules installed in the portal.
This classloader is made available by the method getClassLoader()
, from the interface lumis.portal.deployment.IDeploymentManager
.
This interface is accessible via the method lumis.portal.manager.ManagerFactory.getDeploymentManager()
.
The way a module will adopt the organization of the classloader depends on its scope.
Module Scopes
The scope of a module is defined in its definition file.
This scope can be:
global
-
When the scope of the module is
global
, it is said to be a global module. Global modules form a single classloader, called global classloader. The classes of the global classloader, that is, all classes from all global modules, have visibility among themselves and have visibility of the classes provided by the portal web application's classloader. isolated
(default, if not defined)-
When the scope of the module is
isolated
, it is said to be an isolated module. Classes from distinct isolated modules do not have visibility among themselves. A class from an isolated module has visibility of the other classes within the same module, classes from the global classloader (all classes from all global modules), and classes provided by the portal web application's classloader.
The portal classloader has the following structure:
Each module can include .jar
libraries, if needed, in its META-INF/lib
folder. These libraries must be regular files and named ending with .jar
(lowercase).
Below is an example of visibility among classes:
Legend:
- Purple arrows ⇢
- Visibility of the class
com.company.project.Class1
- Gray arrows ⇢
- Visibility of the class
com.company.project.Class2
- Green arrows ⇢
- Visibility of the class
com.company.project.Class3
- Blue arrows ⇢
- Visibility of the class
com.company.project.Class4
- Orange arrows ⇢
- Visibility of the class
com.company.project.Class5