Class PluginJarProcessor


  • @Dependent
    public class PluginJarProcessor
    extends Object
    Processes and activates deployed plugin jars. The plugin jars can contain GWT .js files, Uberfire Runtime Plugins and html templates. The corresponding GWT .js files are registered with the PluginProcessor and are added to the host page's <head> element by Errai, so the plugin scripts execute before the web application's main script runs. This is required to ensure plugins and their managed beans are discoverable by Errai's bean manager when the main application bootstraps. Uberfire Runtime Plugins are loaded after Errai and Uberfire bootstrap.
    • Constructor Summary

      Constructors 
      Constructor Description
      PluginJarProcessor​(javax.enterprise.inject.Instance<org.uberfire.backend.plugin.PluginProcessor> pluginProcessors, javax.enterprise.event.Event<org.uberfire.workbench.events.PluginReloadedEvent> pluginsReloadedEvent)  
    • Constructor Detail

      • PluginJarProcessor

        @Inject
        public PluginJarProcessor​(@Any
                                  javax.enterprise.inject.Instance<org.uberfire.backend.plugin.PluginProcessor> pluginProcessors,
                                  javax.enterprise.event.Event<org.uberfire.workbench.events.PluginReloadedEvent> pluginsReloadedEvent)
    • Method Detail

      • init

        public void init​(String pluginsDir,
                         String pluginsDeploymentDir)
                  throws IOException
        Processes and loads the currently deployed plugins.
        Parameters:
        pluginsDir - the plugin directory, must not be null.
        pluginsDeploymentDir - the directory to deploy plugin contents to, must not be null.
        Throws:
        IOException
      • reload

        public void reload()
                    throws IOException
        Clears the plugins and reloads all currently deployed plugins. Fires a PluginReloadedEvent when done.
        Throws:
        IOException
      • loadPlugins

        public void loadPlugins​(Path path,
                                boolean notifyClients)
        Unpacks the provided plugin (path pointing to a JAR file), searches for the corresponding plugins files and process the plugin with the corresponding PluginProcessor.
        Parameters:
        path - path to a deployed jar file.
        notifyClients - true if clients should be notified (of added and updated plugins) through CDI events, otherwise false.