Package com.atlassian.plugin.manager
Class DefaultSafeModeManager
java.lang.Object
com.atlassian.plugin.manager.DefaultSafeModeManager
- All Implemented Interfaces:
SafeModeManager
@ParametersAreNonnullByDefault
@ReturnValuesAreNonnullByDefault
public class DefaultSafeModeManager
extends Object
implements SafeModeManager
Default implementation of
SafeModeManager
NB: The safe mode applies only in single node environment! The end application (e.g. JIRA) must implement
ClusterEnvironmentProvider to trigger the safe mode manager logic-
Field Summary
Fields inherited from interface com.atlassian.plugin.manager.SafeModeManager
START_ALL_PLUGINS -
Constructor Summary
ConstructorsConstructorDescriptionDefaultSafeModeManager(PluginMetadataManager pluginMetadataManager, ClusterEnvironmentProvider clusterEnvironmentProvider, SafeModeCommandLineArgumentsFactory safeModeCommandLineArgumentsFactory, PluginPersistentStateStore pluginPersistentStateStore) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanisRequiredPlugin(Plugin plugin) Checks if the plugin is a required onebooleanpluginShouldBeStarted(Plugin plugin, Iterable<ModuleDescriptor> descriptors) This checks if a plugin should be started when safe-mode is on
-
Constructor Details
-
DefaultSafeModeManager
public DefaultSafeModeManager(PluginMetadataManager pluginMetadataManager, ClusterEnvironmentProvider clusterEnvironmentProvider, SafeModeCommandLineArgumentsFactory safeModeCommandLineArgumentsFactory, PluginPersistentStateStore pluginPersistentStateStore)
-
-
Method Details
-
pluginShouldBeStarted
Description copied from interface:SafeModeManagerThis checks if a plugin should be started when safe-mode is on- Specified by:
pluginShouldBeStartedin interfaceSafeModeManager- Parameters:
plugin- to be checked if it should be starteddescriptors- list of module descriptors to find the plugin references that must be started in safe mode (this is kinda tricky way to do such search, but the only available at the startup phase)- Returns:
- true if plugin should be started when the product starts up or false otherwise
-
isInSafeMode
public boolean isInSafeMode()- Specified by:
isInSafeModein interfaceSafeModeManager
-
isRequiredPlugin
Checks if the plugin is a required one- Specified by:
isRequiredPluginin interfaceSafeModeManager- Parameters:
plugin- plugin to be checked- Returns:
- true if the plugin is a system one
-