Package org.ametys.runtime.plugin
Class IncludePolicyFeatureActivator
- java.lang.Object
-
- org.ametys.runtime.plugin.AbstractFeatureActivator
-
- org.ametys.runtime.plugin.IncludePolicyFeatureActivator
-
- All Implemented Interfaces:
FeatureActivator
public final class IncludePolicyFeatureActivator extends AbstractFeatureActivator
FeatureActivator
which activates only passed included features and their dependencies.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IncludePolicyFeatureActivator.IncludedFeature
A feature to include byIncludePolicyFeatureActivator
-
Nested classes/interfaces inherited from interface org.ametys.runtime.plugin.FeatureActivator
FeatureActivator.PluginsInformation
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static String[]
__KERNEL_DEPENDENCIES_NEEDED
private Collection<IncludePolicyFeatureActivator.IncludedFeature>
_includedFeatures
-
Fields inherited from class org.ametys.runtime.plugin.AbstractFeatureActivator
_allPlugins, _correctedDependencies, _logger, _safeMode
-
-
Constructor Summary
Constructors Constructor Description IncludePolicyFeatureActivator(Map<String,Plugin> allPlugins, Collection<IncludePolicyFeatureActivator.IncludedFeature> includedFeatures)
Constructs a new feature activator with an 'include' policy
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private List<String>
_computeDependenciesNowUnused(Collection<String> featuresToDeactivate, Map<String,Collection<String>> outgoingDependencies, List<String> includedFeatures, Map<String,Feature> allFeatures)
private void
_fillRecursiveDependencies(Collection<String> featuresToProcess, Map<String,Collection<String>> outgoingDependencies, List<String> dependencyListToFill, boolean addFeaturesToProcess)
private static PluginsManager.InactivityCause
_getCause(Collection<IncomingDeactivation> deactivatedBy)
private List<String>
_getDependencies(List<String> featuresToProcess, Map<String,Collection<String>> outgoingDependencies)
private Map<String,Collection<IncomingDeactivation>>
_getFeaturesToDeactivate(Map<String,Collection<IncomingDeactivation>> incomingDeactivations, List<String> includedFeatures)
private List<String>
_getIncludedFeatures()
private void
_removeDeactivatedFeatures(Map<String,Feature> activeFeatures, Map<String,PluginsManager.InactivityCause> inactiveFeatures, Map<String,Collection<IncomingDeactivation>> featuresToDeactivate, List<String> dependenciesNowUnused)
private void
_removeUnusedFeatures(Map<String,Feature> activeFeatures, Map<String,PluginsManager.InactivityCause> inactiveFeatures, Collection<String> featuresToKeep)
FeatureActivator.PluginsInformation
computeActiveFeatures(Map<String,String> componentsConfig, boolean safeMode)
Computes the actual plugins and features to load, based on values selected by the administrator.
This method does not actually load nor execute any Java code.String
shortDump(FeatureActivator.PluginsInformation pluginInfo)
Dumps the givenFeatureActivator.PluginsInformation
, in order to log in info level.-
Methods inherited from class org.ametys.runtime.plugin.AbstractFeatureActivator
computeActivePlugins, computeComponents, computeExtensions, computeIncomingDeactivations, computeIncomingDependencies, computeOutgoingDependencies, fullDump, processOutgoingDependencies, removeInactiveFeatures, removeUnusedPassiveFeatures, removeWrongPointReferences
-
-
-
-
Field Detail
-
__KERNEL_DEPENDENCIES_NEEDED
static String[] __KERNEL_DEPENDENCIES_NEEDED
-
_includedFeatures
private Collection<IncludePolicyFeatureActivator.IncludedFeature> _includedFeatures
-
-
Constructor Detail
-
IncludePolicyFeatureActivator
public IncludePolicyFeatureActivator(Map<String,Plugin> allPlugins, Collection<IncludePolicyFeatureActivator.IncludedFeature> includedFeatures)
Constructs a new feature activator with an 'include' policy- Parameters:
allPlugins
- all pluginsincludedFeatures
- the features to include
-
-
Method Detail
-
computeActiveFeatures
public FeatureActivator.PluginsInformation computeActiveFeatures(Map<String,String> componentsConfig, boolean safeMode)
Description copied from interface:FeatureActivator
Computes the actual plugins and features to load, based on values selected by the administrator.
This method does not actually load nor execute any Java code. It reads plugins definitions, selects active features and gets components and extensions definitions.- Parameters:
componentsConfig
- chosen components, among those with the same role.safeMode
-true
if application is in safe mode- Returns:
- all information gathered during plugins reading.
-
_getIncludedFeatures
private List<String> _getIncludedFeatures()
-
_getDependencies
private List<String> _getDependencies(List<String> featuresToProcess, Map<String,Collection<String>> outgoingDependencies)
-
_fillRecursiveDependencies
private void _fillRecursiveDependencies(Collection<String> featuresToProcess, Map<String,Collection<String>> outgoingDependencies, List<String> dependencyListToFill, boolean addFeaturesToProcess)
-
_removeUnusedFeatures
private void _removeUnusedFeatures(Map<String,Feature> activeFeatures, Map<String,PluginsManager.InactivityCause> inactiveFeatures, Collection<String> featuresToKeep)
-
_getFeaturesToDeactivate
private Map<String,Collection<IncomingDeactivation>> _getFeaturesToDeactivate(Map<String,Collection<IncomingDeactivation>> incomingDeactivations, List<String> includedFeatures)
-
_computeDependenciesNowUnused
private List<String> _computeDependenciesNowUnused(Collection<String> featuresToDeactivate, Map<String,Collection<String>> outgoingDependencies, List<String> includedFeatures, Map<String,Feature> allFeatures)
-
_removeDeactivatedFeatures
private void _removeDeactivatedFeatures(Map<String,Feature> activeFeatures, Map<String,PluginsManager.InactivityCause> inactiveFeatures, Map<String,Collection<IncomingDeactivation>> featuresToDeactivate, List<String> dependenciesNowUnused)
-
_getCause
private static PluginsManager.InactivityCause _getCause(Collection<IncomingDeactivation> deactivatedBy)
-
shortDump
public String shortDump(FeatureActivator.PluginsInformation pluginInfo)
Description copied from interface:FeatureActivator
Dumps the givenFeatureActivator.PluginsInformation
, in order to log in info level.- Parameters:
pluginInfo
- The information about plugins- Returns:
- The string to display in info level
-
-