Package org.ametys.runtime.plugin
Class PluginsManager
java.lang.Object
org.ametys.runtime.plugin.PluginsManager
The PluginManager is in charge to load and initialize plugins.
It gives access to the extension points.
It gives access to the extension points.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Cause of the deactivation of a featurestatic enum
PluginsManager status after initialization. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Separator between pluginName and featureNamestatic final String
Context attribute containing the features to include.static final String
Plugin filenamestatic final String
The regexp to determine if a plugin name is correct (add ^ and $ as delimiters if this is your only test)static final String
The regexp to determine if a plugin name is ignored (CVS or .* or *.bak or *.old) -
Method Summary
Modifier and TypeMethodDescriptionReturns all existing plugins definitions.Returns a String array containing the names of the plugins bundled in jarsReturns the components roles.Returns errors gathered during plugins loading.Returns the extensions points and their extensionsReturns loaded features declarations.Returns inactive features id and cause of deactivation.static PluginsManager
Returns the shared instance of thePluginManager
getPluginLocation
(String pluginName) Returns the plugin filesystem location for the given plugin or null if the plugin is loaded from the classpath.Returns the names of the pluginsReturns active plugins declarations.getResourceURI
(String pluginName) Returns the base URI for the given plugin resources, or null if the plugin does not exist or is located in the file system.Returns the status after initialization.init
(ComponentManager parentCM, Context context, String contextPath, boolean forceSafeMode) Initialization of the plugin managerboolean
Returns true if the safe mode is activated.
-
Field Details
-
PLUGIN_NAMES_IGNORED
The regexp to determine if a plugin name is ignored (CVS or .* or *.bak or *.old)- See Also:
-
PLUGIN_NAME_REGEXP
The regexp to determine if a plugin name is correct (add ^ and $ as delimiters if this is your only test)- See Also:
-
FEATURE_ID_SEPARATOR
Separator between pluginName and featureName- See Also:
-
PLUGIN_FILENAME
Plugin filename- See Also:
-
INCLUDED_FEATURES_CONTEXT_ATTRIBUTE
Context attribute containing the features to include.
If presentPluginsManager
will init withIncludePolicyFeatureActivator
and the provided collection of features (as strings).
If not present,PluginsManager
will init withExcludePolicyFeatureActivator
which is the default one.
Use with care.
-
-
Method Details
-
getInstance
Returns the shared instance of thePluginManager
- Returns:
- the shared instance of the PluginManager
-
isSafeMode
Returns true if the safe mode is activated.- Returns:
- true if the safe mode is activated.
-
getErrors
Returns errors gathered during plugins loading.- Returns:
- errors gathered during plugins loading.
-
getPluginNames
Returns the names of the plugins- Returns:
- the names of the plugins
-
getBundledPluginsNames
Returns a String array containing the names of the plugins bundled in jars- Returns:
- a String array containing the names of the plugins bundled in jars
-
getPlugins
Returns active plugins declarations.- Returns:
- active plugins declarations.
-
getAllPlugins
Returns all existing plugins definitions.- Returns:
- all existing plugins definitions.
-
getFeatures
Returns loaded features declarations.
They may be different than active feature in case of safe mode.- Returns:
- loaded features declarations.
-
getInactiveFeatures
Returns inactive features id and cause of deactivation.- Returns:
- inactive features id and cause of deactivation.
-
getExtensionPoints
Returns the extensions points and their extensions- Returns:
- the extensions points and their extensions
-
getComponents
Returns the components roles.- Returns:
- the components roles.
-
getResourceURI
Returns the base URI for the given plugin resources, or null if the plugin does not exist or is located in the file system.- Parameters:
pluginName
- the name of the plugin- Returns:
- the base URI for the given plugin resources, or null if the plugin does not exist or is located in the file system.
-
getPluginLocation
Returns the plugin filesystem location for the given plugin or null if the plugin is loaded from the classpath.- Parameters:
pluginName
- the plugin name- Returns:
- the plugin location for the given plugin
-
getStatus
Returns the status after initialization.- Returns:
- the status after initialization.
-
init
public PluginsComponentManager init(ComponentManager parentCM, Context context, String contextPath, boolean forceSafeMode) throws Exception Initialization of the plugin manager- Parameters:
parentCM
- the parentComponentManager
.context
- the Avalon contextcontextPath
- the Web context path on the server filesystemforceSafeMode
- true to force the application to enter the safe mode- Returns:
- the
PluginsComponentManager
containing loaded components. - Throws:
Exception
- if something wrong occurs during plugins loading
-