public class DefaultPluginsCollector extends Object implements PluginsCollector
./plugins
.
Given repositories are scanned recursively collecting all folders that
contain plugin.xml
or plugin-fragment.xml
and
*.zip
and *.jar
files.
Plug-ins locations descriptor is a simple XML syntax file that stores
locations of all available plug-in manifests and contexts (in terms of
PluginManager.PluginLocation
). Here is an example:
<plugins> <plugin manifest="http://localhost/myPlugins/plugin1/plugin.xml" context="http://localhost/myPlugins/plugin1/"/> <plugin manifest="http://localhost/myPlugins/plugin2/plugin.xml" context="http://localhost/myPlugins/plugin2/"/> <plugin manifest="http://www.plugins.com/repository/plugin1/plugin.xml" context="http://www.plugins.com/repository/plugin1/"/> <plugin manifest="http://www.plugins.com/repository/plugin1/plugin.xml" context="http://www.plugins.com/repository/plugin1/"/> </plugins>Using such simple descriptor you may, for example, publish plug-ins on a site to make them available for clients without needing to download plug-ins manually.
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.logging.Log |
log |
protected static String |
PARAM_PLUGINS_LOCATIONS_DESCRIPTORS |
protected static String |
PARAM_PLUGINS_REPOSITORIES |
Constructor and Description |
---|
DefaultPluginsCollector() |
Modifier and Type | Method and Description |
---|---|
Collection<PluginManager.PluginLocation> |
collectPluginLocations() |
void |
configure(ExtendedProperties config)
Configures this collector instance, this method will be called once
before any other method call in this class.
|
protected void |
processFile(File file,
List<PluginManager.PluginLocation> result) |
protected void |
processFolder(File folder,
List<PluginManager.PluginLocation> result) |
protected static final String PARAM_PLUGINS_REPOSITORIES
protected static final String PARAM_PLUGINS_LOCATIONS_DESCRIPTORS
protected org.apache.commons.logging.Log log
public void configure(ExtendedProperties config) throws Exception
PluginsCollector
configure
in interface PluginsCollector
config
- application configuration data from
boot.properties
file and
System
properties as defaultsException
- if any error has occurred during collector configuringPluginsCollector.configure(
org.java.plugin.util.ExtendedProperties)
public Collection<PluginManager.PluginLocation> collectPluginLocations()
collectPluginLocations
in interface PluginsCollector
plug-in locations
PluginsCollector.collectPluginLocations()
protected void processFolder(File folder, List<PluginManager.PluginLocation> result)
protected void processFile(File file, List<PluginManager.PluginLocation> result)
Copyright © 2016. All Rights Reserved.