Home
Categories
Dictionary
Download
Project Details
Changes Log
Tutorials
FAQ
License

Logging the PluginsManager initialization



This article explains how to log the initialization process of the PluginsManager. This can be useful if for some reason one of your Plugins is not showing in the application.

Enabling the logging

To enable the logging, you must call the PluginsManager.logRegisterProgress(boolean) after calling AbstractApplication.initConfiguration(Preferences pref) and before AbstractApplication.registerPlugins().

For example:
   public class ActionsTutorialMDI extends AbstractMDIApplication {
      public ActionsTutorialMDI() {
        super("ActionsTutorialMDI");
        pluginsDir = new File(System.getProperty("user.dir")); // plugins directory
      
        this.initConfiguration();
        pluginsManager.logRegisterProgress(true);
        this.registerPlugins();
      }
   }

Logging result

The logging is shown on the console. Errors will show on the error stream. For example:
      === Register Plugins ===
      == Load Plugins ==
      === Parse Plugins Manifests ===
      Try to parse Manifest for Plugin /C:/Java/mdiframework/samples/dist/actions/ActionsTutorialPlugin1.jar... Done
      Try to parse Manifest for Plugin /C:/Java/mdiframework/samples/dist/actions/ActionsTutorialPlugin2.jar... Done
  
      == Load Plugin Classes ==
      Try to get Plugin Class for org.actionstutorial.plugins.plugin2.OpenDocumentPlugin... Done
      Try to get Plugin Class for org.actionstutorial.plugins.plugin1.OpenImagePlugin... Done
  
      == Register Plugins ==
      Try to call Plugin.register for Plugin OpenDocuments... Done
      Try to call Plugin.register for Plugin OpenImages... Done
  
      === Init Plugins ===
      == Load Plugins resources ==
      Try to load resources for Plugin OpenDocuments... Done
      Try to load resources for Plugin OpenImages... Done
      == Initialize Plugins ==
      Try to initialize Plugin OpenDocuments... Done
      Try to initialize Plugin OpenImages... Done
  
      === Initialize Plugins after GUI creation ===
      === Reset Plugins settings ===
      Try to reset settings for Plugin OpenDocuments... Done
      Try to reset settings for Plugin OpenImages... Done

See also


Categories: Plugins

Copyright 2006-2023 Herve Girod. All Rights Reserved. Documentation and source under the LGPL v2 and Apache 2.0 licences