Package org.java.plugin.boot
Class DefaultPluginsCollector
java.lang.Object
org.java.plugin.boot.DefaultPluginsCollector
- All Implemented Interfaces:
PluginsCollector
Default implementation of plug-ins collector interface. Supported
configuration parameters are:
- org.java.plugin.boot.pluginsRepositories
- Comma separated list of local plug-in repositories, given folders will
be scanned for plug-ins. Default value is
./plugins
. - org.java.plugin.boot.pluginsLocationsDescriptors
- Comma separated list of URLs for XML syntax files that describe available plug-in locations (see file syntax bellow). No default value provided.
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.
- Version:
- $Id$
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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)
-
Field Details
-
PARAM_PLUGINS_REPOSITORIES
- See Also:
-
PARAM_PLUGINS_LOCATIONS_DESCRIPTORS
- See Also:
-
log
protected org.apache.commons.logging.Log log
-
-
Constructor Details
-
DefaultPluginsCollector
public DefaultPluginsCollector()
-
-
Method Details
-
configure
Description copied from interface:PluginsCollector
Configures this collector instance, this method will be called once before any other method call in this class. There is no pre-defined configuration parameters, see concrete implementations for supported parameters.- Specified by:
configure
in interfacePluginsCollector
- Parameters:
config
- application configuration data fromboot.properties
file andSystem
properties as defaults- Throws:
Exception
- if any error has occurred during collector configuring- See Also:
-
collectPluginLocations
- Specified by:
collectPluginLocations
in interfacePluginsCollector
- Returns:
- collection of all discovered
plug-in locations
- See Also:
-
processFolder
-
processFile
-