org.apache.nutch.plugin

## Class Extension

- java.lang.Object
- - org.apache.nutch.plugin.Extension

-     public class Extension
      extends java.lang.Object

  An `Extension` is a kind of listener descriptor that will be installed on a concrete `ExtensionPoint` that acts as kind of Publisher.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Extension(PluginDescriptor pDescriptor, java.lang.String pExtensionPoint, java.lang.String pId, java.lang.String pExtensionClass, Configuration conf, PluginRepository pluginRepository)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addAttribute(java.lang.String pKey, java.lang.String pValue)` Adds a attribute and is only used until model creation at plugin system start up.
    `java.lang.String` | `getAttribute(java.lang.String pKey)` Returns a attribute value, that is setuped in the manifest file and is definied by the extension point xml schema.
    `java.lang.String` | `getClazz()` Returns the full class name of the extension point implementation
    `PluginDescriptor` | `getDescriptor()` return the plugin descriptor.
    `java.lang.Object` | `getExtensionInstance()` Return an instance of the extension implementatio.
    `java.lang.String` | `getId()` Return the unique id of the extension.
    `java.lang.String` | `getTargetPoint()` Returns the Id of the extension point, that is implemented by this extension.
    `void` | `setClazz(java.lang.String extensionClazz)` Sets the Class that implement the concret extension and is only used until model creation at system start up.
    `void` | `setDescriptor(PluginDescriptor pDescriptor)` Sets the plugin descriptor and is only used until model creation at system start up.
    `void` | `setId(java.lang.String extensionID)` Sets the unique extension Id and is only used until model creation at system start up.
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Extension

          public Extension(PluginDescriptor pDescriptor,
                           java.lang.String pExtensionPoint,
                           java.lang.String pId,
                           java.lang.String pExtensionClass,
                           Configuration conf,
                           PluginRepository pluginRepository)

      Parameters:
        `pDescriptor` - a plugin descriptor
        `pExtensionPoint` - an extension porin
        `pId` - an unique id of the plugin

  - ### Method Detail

    - #### getAttribute

          public java.lang.String getAttribute(java.lang.String pKey)

      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

          public java.lang.String getClazz()

      Returns the full class name of the extension point implementation
      Returns:
        String

    - #### getId

          public java.lang.String getId()

      Return the unique id of the extension.
      Returns:
        String

    - #### addAttribute

          public void addAttribute(java.lang.String pKey,
                                   java.lang.String pValue)

      Adds a attribute and is only used until model creation at plugin system start up.
      Parameters:
        `pKey` - a key
        `pValue` - a value

    - #### setClazz

          public void setClazz(java.lang.String extensionClazz)

      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

          public void setId(java.lang.String extensionID)

      Sets the unique extension Id and is only used until model creation at system start up.
      Parameters:
        `extensionID` - The extensionID to set

    - #### getTargetPoint

          public java.lang.String getTargetPoint()

      Returns the Id of the extension point, that is implemented by this extension.

    - #### getExtensionInstance

          public java.lang.Object getExtensionInstance()
                                                throws PluginRuntimeException

      Return an instance of the extension implementatio. 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 same `PluginClassLoader`. Each Plugin use its own classloader. The PluginClassLoader knows only own Plugin runtime libraries setuped in the plugin manifest file and exported libraries of the depenedend plugins.
      Returns:
        Object An instance of the extension implementation
      Throws:
        `PluginRuntimeException`

    - #### getDescriptor

          public PluginDescriptor getDescriptor()

      return the plugin descriptor.
      Returns:
        PluginDescriptor

    - #### setDescriptor

          public void setDescriptor(PluginDescriptor pDescriptor)

      Sets the plugin descriptor and is only used until model creation at system start up.
      Parameters:
        `pDescriptor` -

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

Copyright © 2019 The Apache Software Foundation