public final class IncludePolicyFeatureActivator extends AbstractFeatureActivator
FeatureActivator
which activates only passed included features and their dependencies.Modifier and Type | Class and Description |
---|---|
static class |
IncludePolicyFeatureActivator.IncludedFeature
A feature to include by
IncludePolicyFeatureActivator |
FeatureActivator.PluginsInformation
Modifier and Type | Field and Description |
---|---|
private static String[] |
__KERNEL_DEPENDENCIES_NEEDED |
private Collection<IncludePolicyFeatureActivator.IncludedFeature> |
_includedFeatures |
_allPlugins, _logger, _safeMode
Constructor and Description |
---|
IncludePolicyFeatureActivator(Map<String,Plugin> allPlugins,
Collection<IncludePolicyFeatureActivator.IncludedFeature> includedFeatures)
Constructs a new feature activator with an 'include' policy
|
Modifier and Type | Method and Description |
---|---|
private List<String> |
_computeDependenciesNowUnused(Collection<String> featuresToDeactivate,
Map<String,Collection<String>> outgoingDependencies,
List<String> includedFeatures,
Map<String,Feature> allFeatures) |
private void |
_dumpFeature(StringBuilder sb,
Feature feature,
Map<String,Collection<String>> dependencies,
Map<String,PluginsManager.InactivityCause> inactiveFeatures) |
private void |
_dumpPlugin(StringBuilder sb,
Plugin plugin,
Map<String,Collection<String>> dependencies,
Map<String,PluginsManager.InactivityCause> inactiveFeatures) |
private void |
_fillRecursiveDependencies(Collection<String> featuresToProcess,
Map<String,Collection<String>> outgoingDependencies,
List<String> dependencyListToFill,
boolean addFeaturesToProcess) |
private Optional<IncludePolicyFeatureActivator.IncludedFeature> |
_find(String featureId) |
private List<String> |
_getDependencies(List<String> featuresToProcess,
Map<String,Collection<String>> outgoingDependencies) |
private Map<String,Collection<String>> |
_getFeaturesToDeactivate(Map<String,Collection<String>> incomingDeactivations,
List<String> includedFeatures) |
private List<String> |
_getIncludedFeatures() |
private void |
_removeDeactivatedFeatures(Map<String,Feature> activeFeatures,
Map<String,PluginsManager.InactivityCause> inactiveFeatures,
Map<String,Collection<String>> 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 given
FeatureActivator.PluginsInformation , in order to log in info level. |
computeActivePlugins, computeComponents, computeExtensions, computeIncomingDeactivations, computeIncomingDependencies, computeOutgoingDependencies, fullDump, processOutgoingDependencies, removeInactiveFeatures, removeUnusedPassiveFeatures, removeWrongPointReferences
private static String[] __KERNEL_DEPENDENCIES_NEEDED
private Collection<IncludePolicyFeatureActivator.IncludedFeature> _includedFeatures
public IncludePolicyFeatureActivator(Map<String,Plugin> allPlugins, Collection<IncludePolicyFeatureActivator.IncludedFeature> includedFeatures)
allPlugins
- all pluginsincludedFeatures
- the features to includepublic FeatureActivator.PluginsInformation computeActiveFeatures(Map<String,String> componentsConfig, boolean safeMode)
FeatureActivator
componentsConfig
- chosen components, among those with the same role.safeMode
- true
if application is in safe modeprivate List<String> _getIncludedFeatures()
private List<String> _getDependencies(List<String> featuresToProcess, Map<String,Collection<String>> outgoingDependencies)
private void _fillRecursiveDependencies(Collection<String> featuresToProcess, Map<String,Collection<String>> outgoingDependencies, List<String> dependencyListToFill, boolean addFeaturesToProcess)
private void _removeUnusedFeatures(Map<String,Feature> activeFeatures, Map<String,PluginsManager.InactivityCause> inactiveFeatures, Collection<String> featuresToKeep)
private Map<String,Collection<String>> _getFeaturesToDeactivate(Map<String,Collection<String>> incomingDeactivations, List<String> includedFeatures)
private List<String> _computeDependenciesNowUnused(Collection<String> featuresToDeactivate, Map<String,Collection<String>> outgoingDependencies, List<String> includedFeatures, Map<String,Feature> allFeatures)
private void _removeDeactivatedFeatures(Map<String,Feature> activeFeatures, Map<String,PluginsManager.InactivityCause> inactiveFeatures, Map<String,Collection<String>> featuresToDeactivate, List<String> dependenciesNowUnused)
public String shortDump(FeatureActivator.PluginsInformation pluginInfo)
FeatureActivator
FeatureActivator.PluginsInformation
, in order to log in info level.pluginInfo
- The information about pluginsprivate void _dumpPlugin(StringBuilder sb, Plugin plugin, Map<String,Collection<String>> dependencies, Map<String,PluginsManager.InactivityCause> inactiveFeatures)
private void _dumpFeature(StringBuilder sb, Feature feature, Map<String,Collection<String>> dependencies, Map<String,PluginsManager.InactivityCause> inactiveFeatures)
private Optional<IncludePolicyFeatureActivator.IncludedFeature> _find(String featureId)