Package org.apache.nutch.plugin
Class Extension
java.lang.Object
org.apache.nutch.plugin.Extension
An
Extension is a kind of listener descriptor that will be
installed on a concrete ExtensionPoint that acts as kind of
Publisher.-
Constructor Summary
ConstructorsConstructorDescriptionExtension(PluginDescriptor pDescriptor, String pExtensionPoint, String pId, String pExtensionClass, Configuration conf, PluginRepository pluginRepository) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(String pKey, String pValue) Adds a attribute and is only used until model creation at plugin system start up.getAttribute(String pKey) Returns a attribute value, that is setuped in the manifest file and is definied by the extension point xml schema.getClazz()Returns the full class name of the extension point implementationGet the plugin descriptor.Return an instance of the extension implementation.getId()Return the unique id of the extension.Get target pointvoidSets the Class that implement the concret extension and is only used until model creation at system start up.voidsetDescriptor(PluginDescriptor pDescriptor) Sets the plugin descriptor and is only used until model creation at system start up.voidSets the unique extension Id and is only used until model creation at system start up.toString()
-
Constructor Details
-
Extension
public Extension(PluginDescriptor pDescriptor, String pExtensionPoint, String pId, String pExtensionClass, Configuration conf, PluginRepository pluginRepository) - Parameters:
pDescriptor- a plugin descriptorpExtensionPoint- an extension pointpId- an unique id of the pluginpExtensionClass- the class extending the extension pointconf- a populatedConfigurationpluginRepository- aPluginRepositorycontaining all plugin artifacts
-
-
Method Details
-
getAttribute
Returns a attribute value, that is setuped in the manifest file and is definied by the extension point xml schema.- Parameters:
pKey- a key- Returns:
- String a value
-
getClazz
Returns the full class name of the extension point implementation- Returns:
- String
-
getId
Return the unique id of the extension.- Returns:
- String
-
addAttribute
Adds a attribute and is only used until model creation at plugin system start up.- Parameters:
pKey- a keypValue- a value
-
setClazz
Sets the Class that implement the concret extension and is only used until model creation at system start up.- Parameters:
extensionClazz- The extensionClasname to set
-
setId
Sets the unique extension Id and is only used until model creation at system start up.- Parameters:
extensionID- The extensionID to set
-
getTargetPoint
Get target point- Returns:
- the Id of the extension point, that is implemented by this extension.
-
getExtensionInstance
Return an instance of the extension implementation. Before we create a extension instance we startup the plugin if it is not already done. The plugin instance and the extension instance use the samePluginClassLoader. Each Plugin uses its own classloader. ThePluginClassLoaderknows only its own plugin runtime libraries defined in theplugin.xmlmanifest file and exported libraries of the dependent plugins.- Returns:
- Object An instance of the extension implementation
- Throws:
PluginRuntimeException- if there is a fatal runtime error
-
getDescriptor
Get the plugin descriptor.- Returns:
- PluginDescriptor
-
setDescriptor
Sets the plugin descriptor and is only used until model creation at system start up.- Parameters:
pDescriptor- a instantiatedPluginDescriptor
-
toString
-