JPF 0.10

org.java.plugin.boot
Class DefaultPluginsCollector

java.lang.Object
  extended byorg.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 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: DefaultPluginsCollector.java,v 1.5 2006/04/09 14:42:47 ddimon Exp $

Field Summary
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
DefaultPluginsCollector()
           
 
Method Summary
 java.util.Collection 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 result)
           
protected  void processFolder(java.io.File folder, java.util.List result)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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
Constructor Detail

DefaultPluginsCollector

public DefaultPluginsCollector()
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 interface PluginsCollector
Parameters:
config - application configuration data from boot.properties file and System 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 collectPluginLocations()
Specified by:
collectPluginLocations in interface PluginsCollector
Returns:
collection of all discovered plug-in locations
See Also:
PluginsCollector.collectPluginLocations()

processFolder

protected void processFolder(java.io.File folder,
                             java.util.List result)

processFile

protected void processFile(java.io.File file,
                           java.util.List result)

JPF 0.10

Copyright © 2004-2005 Dmitry Olshansky. All Rights Reserved.