Class PluginController


  • public final class PluginController
    extends Object
    The plugin-controller controls everything about plugins.
    Here you can check if some plugins are active/loaded and add your localizations to the main application from plugin-side with addLocalization(String).
    • Method Detail

      • addPlugin

        public void addPlugin​(String pluginName,
                              Class<? extends IPlugin> plugin)
        This method adds the plugin to the cachedPlugins map. Only needed for internal usage.
        Parameters:
        pluginName -
        plugin -
      • getCachedPlugins

        public HashMap<String,​Class<? extends IPlugin>> getCachedPlugins()
        Return the CachedPlugins map.
        Only needed for internal usage.
        Returns:
      • checkPluginActiv

        public boolean checkPluginActiv​(String pluginName)
        Checks if the plugin should be used or not.
        If not, the plugin will not be loaded by the Classloader for security reasons.
        By default, every plugin is not active to be secure.
        Parameters:
        pluginName -
        Returns:
      • addLocalization

        public void addLocalization​(String path,
                                    String languageDefinition,
                                    String name)
        This method adds localizations to Loader.props
        Parameters:
        path - The path where to find the localisation files
        languageDefinition - The shot-name of the language like "de_DE" for germany or "en_EN" for english
        name - The Name of the properties files They must start with the language shortcut like "de_DE" for germany or "en_EN" for english separated by an underscore and then the normal name mostly the plugin-name. An Example could be something like: addLocalization("DBPluginHibernate");
      • addLocalization

        public void addLocalization​(String path,
                                    String name)
        This method will be invoked by addLocalization(String)
        Parameters:
        path - The path where to find the localisation files
        name - The Name of the properties files They must start with the language short-name like "de_DE" for germany or "en_EN" for english separated by an underscore and then the normal name mostly the plugin-name. An Example could be something like: addLocalization("DBPluginHibernate");
      • addLocalization

        public void addLocalization​(String name)
        This Method has to be invoked by any plugin which has localizations to be added.
        Parameters:
        name - The Name of the properties files They must start with the language shortcut like "de_DE" for germany or "en_EN" for english separated by an underscore and then the normal name mostly the plugin-name. An Example could be something like: addLocalization("DBPluginHibernate");