public class DefaultPluginsCollector extends java.lang.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 Log |
log |
protected static java.lang.String |
PARAM_PLUGINS_LOCATIONS_DESCRIPTORS |
protected static java.lang.String |
PARAM_PLUGINS_REPOSITORIES |
Constructor and Description |
---|
DefaultPluginsCollector() |
Modifier and Type | Method and Description |
---|---|
java.util.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(java.io.File file,
java.util.List<PluginManager.PluginLocation> result) |
protected void |
processFolder(java.io.File folder,
java.util.List<PluginManager.PluginLocation> result) |
protected static final java.lang.String PARAM_PLUGINS_REPOSITORIES
protected static final java.lang.String PARAM_PLUGINS_LOCATIONS_DESCRIPTORS
protected Log log
public void configure(ExtendedProperties config) throws java.lang.Exception
PluginsCollector
configure
in interface PluginsCollector
config
- application configuration data from
boot.properties
file and
System
properties as defaultsjava.lang.Exception
- if any error has occurred during collector configuringPluginsCollector.configure(
org.java.plugin.util.ExtendedProperties)
public java.util.Collection<PluginManager.PluginLocation> collectPluginLocations()
collectPluginLocations
in interface PluginsCollector
plug-in locations
PluginsCollector.collectPluginLocations()
protected void processFolder(java.io.File folder, java.util.List<PluginManager.PluginLocation> result)
protected void processFile(java.io.File file, java.util.List<PluginManager.PluginLocation> result)
Copyright © 2004-2007 Dmitry Olshansky. All Rights Reserved.