Class ModulesClassLoadersUtils

java.lang.Object
com.apgar.common.lib.utils.ModulesClassLoadersUtils

public class ModulesClassLoadersUtils extends Object
Utility class for managing and retrieving class loaders for modules.
  • Method Details

    • getInstance

      public static ModulesClassLoadersUtils getInstance()
      Retrieves the instance of ModulesClassLoadersUtils.
      Returns:
      the single instance of ModulesClassLoadersUtils.
    • getClassLoader

      public ClassLoader getClassLoader(String moduleName)
      Retrieves the class loader for the specified module name.

      If the class loader is already cached, it will return the cached instance. Otherwise, it will retrieve the class loader from the ModuleHome and cache it for future use.

      Parameters:
      moduleName - the name of the module for which to retrieve the class loader
      Returns:
      the class loader for the specified module, or null if the module is not registered.