Package org.ametys.runtime.plugin
Class AbstractFeatureActivator
- java.lang.Object
-
- org.ametys.runtime.plugin.AbstractFeatureActivator
-
- All Implemented Interfaces:
FeatureActivator
- Direct Known Subclasses:
ExcludePolicyFeatureActivator
,IncludePolicyFeatureActivator
public abstract class AbstractFeatureActivator extends Object implements FeatureActivator
Basic impl
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ametys.runtime.plugin.FeatureActivator
FeatureActivator.PluginsInformation
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,Plugin>
_allPlugins
Map of association identifier, pluginprotected org.ametys.runtime.plugin.CorrectedDependencies
_correctedDependencies
the computed and corrected dependenciesprotected org.slf4j.Logger
_logger
Loggerprotected boolean
_safeMode
true when in safe mode
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<String,Plugin>
computeActivePlugins(Collection<String> excludedPlugins, Map<String,Feature> initialFeatures, Map<String,PluginsManager.InactivityCause> inactiveFeatures, Map<String,ExtensionPointDefinition> extensionPoints, Collection<PluginIssue> errors)
Compute the active pluginsprotected Map<String,ComponentDefinition>
computeComponents(Map<String,Feature> features, Map<String,String> componentsConfig, Collection<PluginIssue> errors)
compute the componentsprotected Map<String,Map<String,ExtensionDefinition>>
computeExtensions(Map<String,Feature> features, Collection<PluginIssue> errors)
Compute the extensionsprotected Map<String,Collection<org.ametys.runtime.plugin.IncomingDeactivation>>
computeIncomingDeactivations(Map<String,Feature> features)
Compute incoming deactivationsprotected Map<String,Collection<String>>
computeIncomingDependencies(Map<String,Feature> features)
Compute incoming dependenciesprotected Map<String,Collection<String>>
computeOutgoingDependencies(Map<String,Feature> features)
Compute the outgoing dependenciesString
fullDump(FeatureActivator.PluginsInformation pluginInfo)
Dumps the givenFeatureActivator.PluginsInformation
, in order to log in debug level.protected Map<String,Feature>
processOutgoingDependencies(Map<String,Feature> initialFeatures, Map<String,PluginsManager.InactivityCause> inactiveFeatures, Collection<PluginIssue> errors)
Process the outgoing dependenciesprotected void
removeInactiveFeatures(Map<String,Feature> initialFeatures, Map<String,PluginsManager.InactivityCause> inactiveFeatures, Map<String,Collection<org.ametys.runtime.plugin.IncomingDeactivation>> incomingDeactivations, Map<String,String> componentsConfig)
Remove inactive featuresprotected void
removeUnusedPassiveFeatures(Map<String,Feature> features, Map<String,PluginsManager.InactivityCause> inactiveFeatures, Map<String,Collection<String>> incomingDependencies)
Remove the unused features that were declared passiveprotected void
removeWrongPointReferences(Map<String,Feature> initialFeatures, Map<String,PluginsManager.InactivityCause> inactiveFeatures, Map<String,ExtensionPointDefinition> extensionPoints, Collection<PluginIssue> errors)
Remove the wrong points-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ametys.runtime.plugin.FeatureActivator
computeActiveFeatures, shortDump
-
-
-
-
Field Detail
-
_logger
protected final org.slf4j.Logger _logger
Logger
-
_allPlugins
protected final Map<String,Plugin> _allPlugins
Map of association identifier, plugin
-
_safeMode
protected boolean _safeMode
true when in safe mode
-
_correctedDependencies
protected org.ametys.runtime.plugin.CorrectedDependencies _correctedDependencies
the computed and corrected dependencies
-
-
Method Detail
-
computeActivePlugins
protected Map<String,Plugin> computeActivePlugins(Collection<String> excludedPlugins, Map<String,Feature> initialFeatures, Map<String,PluginsManager.InactivityCause> inactiveFeatures, Map<String,ExtensionPointDefinition> extensionPoints, Collection<PluginIssue> errors)
Compute the active plugins- Parameters:
excludedPlugins
- The excluded pluginsinitialFeatures
- The featuresinactiveFeatures
- The features that are inactiveextensionPoints
- The extension pointserrors
- The issues- Returns:
- The active plugins
-
computeIncomingDeactivations
protected Map<String,Collection<org.ametys.runtime.plugin.IncomingDeactivation>> computeIncomingDeactivations(Map<String,Feature> features)
Compute incoming deactivations- Parameters:
features
- The features- Returns:
- The deactivations
-
removeInactiveFeatures
protected void removeInactiveFeatures(Map<String,Feature> initialFeatures, Map<String,PluginsManager.InactivityCause> inactiveFeatures, Map<String,Collection<org.ametys.runtime.plugin.IncomingDeactivation>> incomingDeactivations, Map<String,String> componentsConfig)
Remove inactive features- Parameters:
initialFeatures
- The initial featuresinactiveFeatures
- The inactive featuresincomingDeactivations
- The deactivationscomponentsConfig
- The components
-
removeWrongPointReferences
protected void removeWrongPointReferences(Map<String,Feature> initialFeatures, Map<String,PluginsManager.InactivityCause> inactiveFeatures, Map<String,ExtensionPointDefinition> extensionPoints, Collection<PluginIssue> errors)
Remove the wrong points- Parameters:
initialFeatures
- The initial featuresinactiveFeatures
- The inactive featuresextensionPoints
- The extension pointserrors
- The errors
-
processOutgoingDependencies
protected Map<String,Feature> processOutgoingDependencies(Map<String,Feature> initialFeatures, Map<String,PluginsManager.InactivityCause> inactiveFeatures, Collection<PluginIssue> errors)
Process the outgoing dependencies- Parameters:
initialFeatures
- The initial featuresinactiveFeatures
- The inactive featureserrors
- The errors- Returns:
- the outgoing dependencies
-
computeIncomingDependencies
protected Map<String,Collection<String>> computeIncomingDependencies(Map<String,Feature> features)
Compute incoming dependencies- Parameters:
features
- The features- Returns:
- The dependencies
-
computeOutgoingDependencies
protected Map<String,Collection<String>> computeOutgoingDependencies(Map<String,Feature> features)
Compute the outgoing dependencies- Parameters:
features
- The features- Returns:
- The dependencies
-
removeUnusedPassiveFeatures
protected void removeUnusedPassiveFeatures(Map<String,Feature> features, Map<String,PluginsManager.InactivityCause> inactiveFeatures, Map<String,Collection<String>> incomingDependencies)
Remove the unused features that were declared passive- Parameters:
features
- The featuresinactiveFeatures
- The inactive featuresincomingDependencies
- The dependencies
-
computeExtensions
protected Map<String,Map<String,ExtensionDefinition>> computeExtensions(Map<String,Feature> features, Collection<PluginIssue> errors)
Compute the extensions- Parameters:
features
- The featureserrors
- The errors- Returns:
- The extensions
-
computeComponents
protected Map<String,ComponentDefinition> computeComponents(Map<String,Feature> features, Map<String,String> componentsConfig, Collection<PluginIssue> errors)
compute the components- Parameters:
features
- The featurescomponentsConfig
- The component configurationserrors
- The errors- Returns:
- The components
-
fullDump
public String fullDump(FeatureActivator.PluginsInformation pluginInfo)
Description copied from interface:FeatureActivator
Dumps the givenFeatureActivator.PluginsInformation
, in order to log in debug level.- Specified by:
fullDump
in interfaceFeatureActivator
- Parameters:
pluginInfo
- The information about plugins- Returns:
- The string to display in debug level
-
-