org.apache.nutch.plugin
Class PluginRepository

java.lang.Object
  extended byorg.apache.nutch.plugin.PluginRepository

public class PluginRepository
extends Object

The plugin repositority is a registry of all plugins. At system boot up a repositority is builded by parsing the mainifest files of all plugins. Plugins that require not existing other plugins are not registed. For each plugin a plugin descriptor instance will be created. The descriptor represents all meta information about a plugin. So a plugin instance will be created later when it is required, this allow lazy plugin loading.

Author:
joa23

Field Summary
static Logger LOG
           
 
Method Summary
 void finalize()
           
 ExtensionPoint getExtensionPoint(String pXpId)
          Returns a extension point indentified by a extension point id.
static PluginRepository getInstance()
          Returns the singelton instance of the PluginRepository
 PluginDescriptor getPluginDescriptor(String pPluginId)
          Returns the descriptor of one plugin identified by a plugin id.
 PluginDescriptor[] getPluginDescriptors()
          Returns all registed plugin descriptors.
 Plugin getPluginInstance(PluginDescriptor pDescriptor)
          Returns a instance of a plugin.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final Logger LOG
Method Detail

getInstance

public static PluginRepository getInstance()
Returns the singelton instance of the PluginRepository


getPluginDescriptors

public PluginDescriptor[] getPluginDescriptors()
Returns all registed plugin descriptors.

Returns:
PluginDescriptor[]

getPluginDescriptor

public PluginDescriptor getPluginDescriptor(String pPluginId)
Returns the descriptor of one plugin identified by a plugin id.

Parameters:
pPluginId -
Returns:
PluginDescriptor

getExtensionPoint

public ExtensionPoint getExtensionPoint(String pXpId)
Returns a extension point indentified by a extension point id.

Parameters:
pXpId -

getPluginInstance

public Plugin getPluginInstance(PluginDescriptor pDescriptor)
                         throws PluginRuntimeException
Returns a instance of a plugin. Plugin instances are cached. So a plugin exist only as one instance. This allow a central management of plugin own resources. After creating the plugin instance the startUp() method is invoked. The plugin use a own classloader that is used as well by all instance of extensions of the same plugin. This class loader use all exported libraries from the dependend plugins and all plugin libraries.

Parameters:
pDescriptor -
Returns:
Plugin
Throws:
PluginRuntimeException

finalize

public void finalize()
              throws Throwable
Throws:
Throwable


Copyright © 2006 The Apache Software Foundation