Package com.logicaldoc.util.plugin
Class PluginRegistry
java.lang.Object
com.logicaldoc.util.plugin.PluginRegistry
- Direct Known Subclasses:
DefaultPluginRegistry
Central point where plugins are loaded and handled. The class is abstract and
must be personalized as needed. The used implementation can be specified with
the 'logicaldoc.app.pluginregistry' system property.
- Since:
- 3.0
- Author:
- Marco Meschieri - LogicalDOC
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCollection
<org.java.plugin.registry.Extension> getExtensions
(String pluginId, String extensionPoint) Returns the extensions connected to the specified extension pointstatic PluginRegistry
org.java.plugin.PluginManager
org.java.plugin.registry.PluginDescriptor
Retrieve the plugin descriptorstatic File
getPluginHome
(String pluginName) This method retrieves the folder of the given plugin.static File
getPluginResource
(String pluginName, String path) This method retrieves a plugin folder resource (file or folder).Collection
<org.java.plugin.registry.PluginDescriptor> Retrieves the list of registered pluginsstatic File
This method retrieves the plugins root folder.List
<org.java.plugin.registry.Extension> getSortedExtensions
(String pluginId, String extensionPoint, String sortingParameter) Returns the extensions connected to the specified extension pointvoid
Initializes all found pluginsboolean
void
-
Constructor Details
-
PluginRegistry
public PluginRegistry()
-
-
Method Details
-
getInstance
-
init
Initializes all found plugins- Parameters:
pluginsDir
- the root folder where the plugins files are located- Throws:
PluginException
- Error trying to publish the plugins
-
getManager
public org.java.plugin.PluginManager getManager() -
getExtensions
public Collection<org.java.plugin.registry.Extension> getExtensions(String pluginId, String extensionPoint) Returns the extensions connected to the specified extension point- Parameters:
pluginId
- The plugin identifierextensionPoint
- The extension point id- Returns:
- List of connected extensions
-
getSortedExtensions
public List<org.java.plugin.registry.Extension> getSortedExtensions(String pluginId, String extensionPoint, String sortingParameter) Returns the extensions connected to the specified extension point- Parameters:
pluginId
- The plugin identifierextensionPoint
- The extension point idsortingParameter
- Extensions will be sorted by this parameter (if null 'position' parameter is used)- Returns:
- List of connected extensions
-
getPlugins
Retrieves the list of registered plugins- Returns:
- The list of registered plugins descriptors
-
getPlugin
Retrieve the plugin descriptor- Parameters:
pluginId
- identifier of the plugin- Returns:
- The plugin descriptor
-
isRestartRequired
public boolean isRestartRequired() -
setRestartRequired
public void setRestartRequired() -
getPluginHome
This method retrieves the folder of the given plugin. If not exists, it creates the folder. The folder is: conf.plugindir/pluginName- Parameters:
pluginName
- The plugin name- Returns:
- the directory used as plugin's home
-
getPluginsDir
This method retrieves the plugins root folder. If not exists, it creates the folder. The folder is: conf.plugindir- Returns:
- root of the plugins data folders
-
getPluginResource
This method retrieves a plugin folder resource (file or folder). If the resource is a folder and not exists, it creates the folder. The folder will be: conf.plugindir/pluginName/path- Parameters:
pluginName
- The plugin namepath
- The resource path- Returns:
- the plugin's resource
-