Interface ModuleHook

All Superinterfaces:
ResourceBundleProvider

public interface ModuleHook extends ResourceBundleProvider
Interface to determine the module hierarchy.
Provides a hook to access resources from within a module.

Each application module must include exactly one such implementation and provide it via module-info:

 provides org.tentackle.common.ModuleHook with com.myapp.somepackage.Hook;
Modules without a hook are not part of the module hierarchy determined by the ModuleSorter and are treated like automatic modules or the classpath.

Since ModuleHook extends ResourceBundleProvider, all classes must implement the following method:

   @Override
   public ResourceBundle getBundle(String baseName, Locale locale) {
     return ResourceBundle.getBundle(baseName, locale);
   }
Notice: it must be implemented in the hook itself and not in an abstract superclass, because it is used by the BundleFactory to access the bundles from within the framework, and ResourceBundle uses the caller class to determine the caller module.
Author:
harald