class PluginManager extends Object
A PluginManager singleton is hold by the CoreServiceImpl
and is accessed concurrently
by all bundle activation threads (as created e.g. by the File Install bundle).
Modifier and Type | Field and Description |
---|---|
private Map<String,PluginImpl> |
activatedPlugins
The pool of activated plugins.
|
private CoreServiceImpl |
dmx |
private Logger |
logger |
Constructor and Description |
---|
PluginManager(CoreServiceImpl dmx) |
Modifier and Type | Method and Description |
---|---|
private boolean |
_isPluginActivated(String pluginUri) |
(package private) void |
activatePlugin(PluginImpl plugin)
Activates a plugin.
|
private void |
addToActivatedPlugins(PluginImpl plugin) |
private boolean |
checkAllPluginsActivated()
Checks if all installed plugins are activated.
|
(package private) void |
deactivatePlugin(PluginImpl plugin) |
(package private) PluginImpl |
getPlugin(String pluginUri) |
(package private) List<PluginInfo> |
getPluginInfo() |
private boolean |
isDMXPlugin(org.osgi.framework.Bundle bundle)
Plugin detection: checks if an arbitrary bundle is a DMX plugin.
|
(package private) boolean |
isPluginActivated(String pluginUri) |
private void |
removeFromActivatedPlugins(String pluginUri) |
private Map<String,PluginImpl> activatedPlugins
private CoreServiceImpl dmx
PluginManager(CoreServiceImpl dmx)
void activatePlugin(PluginImpl plugin)
Once the plugin is activated checks if all installed plugins are activated now, and if so, fires the
CoreEvent.ALL_PLUGINS_ACTIVE
core event.
If the plugin is already activated, nothing is performed. This happens e.g. when a dependent plugin is redeployed.
Note: this method is synchronized. While a plugin is activated no other plugin must be activated. Otherwise the "type introduction" mechanism might miss some types. Consider this unsynchronized scenario: plugin B starts running its migrations just in the moment between plugin A's type introduction and event listener registration. Plugin A might miss some of the types created by plugin B.
void deactivatePlugin(PluginImpl plugin)
boolean isPluginActivated(String pluginUri)
PluginImpl getPlugin(String pluginUri)
List<PluginInfo> getPluginInfo()
private boolean checkAllPluginsActivated()
private boolean isDMXPlugin(org.osgi.framework.Bundle bundle)
private void addToActivatedPlugins(PluginImpl plugin)
private void removeFromActivatedPlugins(String pluginUri)
private boolean _isPluginActivated(String pluginUri)
Copyright © 2018. All Rights Reserved.