AbstractPluginLoader (Solr 3.6.2 API)
Keywords: org.apache.solr.util.plugin.AbstractPluginLoader class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.solr.util.plugin
Class AbstractPluginLoader<T>

    java.lang.Object
      org.apache.solr.util.plugin.AbstractPluginLoader<T>

Direct Known Subclasses:
  MapPluginLoader, NamedListPluginLoader

    public abstract class AbstractPluginLoader<T>

extends Object

An abstract super class that manages standard solr-style plugin configuration.

Since:
  solr 1.3
Version:
  $Id: AbstractPluginLoader.java 1052938 2010-12-26 20:21:48Z rmuir $

Field Summary
`static org.slf4j.Logger` | `log`

Constructor Summary
`AbstractPluginLoader(String type)`
`AbstractPluginLoader(String type, boolean preRegister, boolean requireName)`

Method Summary
`protected T` | `create(ResourceLoader loader, String name, String className, Node node)` Create a plugin from an XML configuration.
`protected String[]` | `getDefaultPackages()` Where to look for classes
`protected abstract void` | `init(T plugin, Node node)` Initialize the plugin.
`T` | `load(ResourceLoader loader, NodeList nodes)` Given a NodeList from XML in the form: ...
`T` | `loadSingle(ResourceLoader loader, Node node)` Given a NodeList from XML in the form: ...
`protected abstract T` | `register(String name, T plugin)` Register a plugin with a given name.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### log

    public static org.slf4j.Logger log

Constructor Detail

### AbstractPluginLoader

    public AbstractPluginLoader(String type,
                                boolean preRegister,
                                boolean requireName)

Parameters:
  `type` - is the 'type' name included in error messages.
  `preRegister` - if true, this will first register all Plugins, then it will initialize them.

### AbstractPluginLoader

    public AbstractPluginLoader(String type)

Method Detail

### getDefaultPackages

    protected String[] getDefaultPackages()

  Where to look for classes

### create

    protected T create(ResourceLoader loader,
                       String name,
                       String className,
                       Node node)
                throws Exception

  Create a plugin from an XML configuration. Plugins are defined using: ...

  Parameters:
    `name` - - The registered name. In the above example: "name1"
    `className` - - class name for requested plugin. In the above example: "solr.ClassName"
    `node` - - the XML node defining this plugin
  Throws:
    `Exception`

### register

    protected abstract T register(String name,
                                  T plugin)
                           throws Exception

  Register a plugin with a given name.

  Returns:
    The plugin previously registered to this name, or null
  Throws:
    `Exception`

### init

    protected abstract void init(T plugin,
                                 Node node)
                          throws Exception

  Initialize the plugin.

  Parameters:
    `plugin` - - the plugin to initialize
    `node` - - the XML node defining this plugin
  Throws:
    `Exception`

### load

    public T load(ResourceLoader loader,
                  NodeList nodes)

  Given a NodeList from XML in the form: ... ... This will initialize and register each plugin from the list. A class will be generated for each class name and registered to the given name. If 'preRegister' is true, each plugin will be registered *before* it is initialized This may be useful for implementations that need to inspect other registered plugins at startup. One (and only one) plugin may declare itself to be the 'default' plugin using: If a default element is defined, it will be returned from this function.

### loadSingle

    public T loadSingle(ResourceLoader loader,
                        Node node)

  Given a NodeList from XML in the form: ... This will initialize and register a single plugin. A class will be generated for the plugin and registered to the given name. If 'preRegister' is true, the plugin will be registered *before* it is initialized This may be useful for implementations that need to inspect other registered plugins at startup. The created class for the plugin will be returned from this function.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD