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 CorrectedDependencies
_correctedDependencies
the computed and corrected dependenciesprotected org.slf4j.Logger
_logger
Loggerprotected boolean
_safeMode
true when in safe mode
-
Constructor Summary
Constructors Constructor Description AbstractFeatureActivator(Map<String,Plugin> allPlugins)
-
Method Summary
-
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 CorrectedDependencies _correctedDependencies
the computed and corrected dependencies
-
-
Constructor Detail
-
AbstractFeatureActivator
AbstractFeatureActivator(Map<String,Plugin> allPlugins)
-
-
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<IncomingDeactivation>> computeIncomingDeactivations(Map<String,Feature> features)
Compute incoming deactivations- Parameters:
features
- The features- Returns:
- The deactivations
-
_fillDeactivationsByFeature
private void _fillDeactivationsByFeature(String featureIdTriggeringDeactivation, Collection<String> deactivations, Map<String,Collection<IncomingDeactivation>> incomingDeactivations)
-
_fillOverridesByFeature
private void _fillOverridesByFeature(String featureIdTriggeringOverride, Collection<String> overrides, Map<String,Collection<IncomingDeactivation>> incomingDeactivations)
-
_checkNoMultipleOverriders
private void _checkNoMultipleOverriders(Map<String,Collection<IncomingDeactivation>> incomingDeactivations)
-
removeInactiveFeatures
protected void removeInactiveFeatures(Map<String,Feature> initialFeatures, Map<String,PluginsManager.InactivityCause> inactiveFeatures, Map<String,Collection<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
-
_processOutgoingDependenciesForFeature
private boolean _processOutgoingDependenciesForFeature(Iterator<String> initialFeatureIterator, Map<String,Feature> initialFeatures, Map<String,PluginsManager.InactivityCause> inactiveFeatures, String currentInitialFeatureId)
-
_computeFeaturesDependencies
private void _computeFeaturesDependencies(String featureId, Map<String,Feature> initialFeatures, Map<String,Feature> resultFeatures, List<String> involvedFeaturesInDependencyChain, Collection<PluginIssue> errors)
-
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
-
-