Package org.java.plugin.boot
Class DefaultPluginsCollector
- java.lang.Object
-
- org.java.plugin.boot.DefaultPluginsCollector
-
- All Implemented Interfaces:
PluginsCollector
public class DefaultPluginsCollector extends java.lang.Object implements 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
orplugin-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 Modifier and Type Field Description protected org.apache.commons.logging.Log
log
protected static java.lang.String
PARAM_PLUGINS_LOCATIONS_DESCRIPTORS
protected static java.lang.String
PARAM_PLUGINS_REPOSITORIES
-
Constructor Summary
Constructors Constructor Description DefaultPluginsCollector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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)
-
-
-
Field Detail
-
PARAM_PLUGINS_REPOSITORIES
protected static final java.lang.String PARAM_PLUGINS_REPOSITORIES
- See Also:
- Constant Field Values
-
PARAM_PLUGINS_LOCATIONS_DESCRIPTORS
protected static final java.lang.String PARAM_PLUGINS_LOCATIONS_DESCRIPTORS
- See Also:
- Constant Field Values
-
log
protected org.apache.commons.logging.Log log
-
-
Method Detail
-
configure
public void configure(ExtendedProperties config) throws java.lang.Exception
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:
java.lang.Exception
- if any error has occurred during collector configuring- See Also:
PluginsCollector.configure( org.java.plugin.util.ExtendedProperties)
-
collectPluginLocations
public java.util.Collection<PluginManager.PluginLocation> collectPluginLocations()
- Specified by:
collectPluginLocations
in interfacePluginsCollector
- Returns:
- collection of all discovered
plug-in locations
- See Also:
PluginsCollector.collectPluginLocations()
-
processFolder
protected void processFolder(java.io.File folder, java.util.List<PluginManager.PluginLocation> result)
-
processFile
protected void processFile(java.io.File file, java.util.List<PluginManager.PluginLocation> result)
-
-