Package com.logicaldoc.util.plugin
Class PluginRegistry
- java.lang.Object
-
- com.logicaldoc.util.plugin.PluginRegistry
-
- Direct Known Subclasses:
DefaultPluginRegistry
public abstract class PluginRegistry extends Object
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
Constructors Constructor Description PluginRegistry()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<org.java.plugin.registry.Extension>
getExtensions(String pluginId, String extensionPoint)
Returns the extensions connected to the specified extension pointstatic PluginRegistry
getInstance()
org.java.plugin.PluginManager
getManager()
org.java.plugin.registry.PluginDescriptor
getPlugin(String pluginId)
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>
getPlugins()
Retrieves the list of registered pluginsstatic File
getPluginsDir()
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
init(String pluginsDir)
Initializes all found pluginsboolean
isRestartRequired()
void
setRestartRequired()
-
-
-
Method Detail
-
getInstance
public static PluginRegistry getInstance()
-
init
public void init(String pluginsDir)
Initializes all found plugins- Parameters:
pluginsDir
- the root folder where the plugins files are located
-
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
public Collection<org.java.plugin.registry.PluginDescriptor> getPlugins()
Retrieves the list of registered plugins- Returns:
- The list of registered plugins descriptors
-
getPlugin
public org.java.plugin.registry.PluginDescriptor getPlugin(String pluginId)
Retrieve the plugin descriptor- Parameters:
pluginId
- identifier of the plugin- Returns:
- The plugin descriptor
-
isRestartRequired
public boolean isRestartRequired()
-
setRestartRequired
public void setRestartRequired()
-
getPluginHome
public static File getPluginHome(String pluginName)
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
public static File 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
public static File getPluginResource(String pluginName, String path)
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
-
-