Class PluginJarProcessor
- java.lang.Object
-
- org.uberfire.backend.server.plugins.engine.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 thePluginProcessorand 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)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinit(String pluginsDir, String pluginsDeploymentDir)Processes and loads the currently deployed plugins.voidloadPlugins(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 correspondingPluginProcessor.voidreload()Clears the plugins and reloads all currently deployed plugins.
-
-
-
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 IOExceptionClears the plugins and reloads all currently deployed plugins. Fires aPluginReloadedEventwhen 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 correspondingPluginProcessor.- 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.
-
-