@Dependent public class GwtRuntimePluginLoader extends Object
PluginRegistry and are added to the host page's
<head> element by Errai, so that all 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.| Constructor and Description |
|---|
GwtRuntimePluginLoader(javax.enterprise.event.Event<PluginAddedEvent> pluginAddedEvent,
javax.enterprise.event.Event<PluginUpdatedEvent> pluginUpdatedEvent,
javax.enterprise.event.Event<PluginsReloadedEvent> pluginsReloadedEvent) |
| Modifier and Type | Method and Description |
|---|---|
void |
init(String contextRootDir,
String pluginDir,
String pluginDeploymentDir,
PluginRegistry pluginRegistry)
Processes and loads the currently deployed plugins.
|
void |
loadPlugin(Path path,
boolean notifyClients)
Unpacks the provided plugin (path pointing to a JAR file), searches for
the corresponding JavaScript file and registers the plugin url with the
PluginRegistry. |
void |
reload()
Clears the plugin registry and reloads all currently deployed plugins.
|
@Inject public GwtRuntimePluginLoader(javax.enterprise.event.Event<PluginAddedEvent> pluginAddedEvent, javax.enterprise.event.Event<PluginUpdatedEvent> pluginUpdatedEvent, javax.enterprise.event.Event<PluginsReloadedEvent> pluginsReloadedEvent)
public void init(String contextRootDir, String pluginDir, String pluginDeploymentDir, PluginRegistry pluginRegistry) throws IOException
contextRootDir - the web application's context root directory, must not be
null.pluginDir - the plugin directory, must not be null.pluginDeploymentDir - the directory to deploy plugin contents to, must not be null.IOExceptionpublic void reload()
throws IOException
PluginsReloadedEvent when done.IOExceptionpublic void loadPlugin(Path path, boolean notifyClients)
PluginRegistry.path - path to a deployed jar file.notifyClients - true if clients should be notified (of added and updated
plugins) through CDI events, otherwise false.Copyright © 2012–2017 JBoss by Red Hat. All rights reserved.