Regain 2.1.0-STABLE API

net.sf.regain.crawler.document
Class PluggableFactory

java.lang.Object
  extended by net.sf.regain.crawler.document.PluggableFactory
Direct Known Subclasses:
CrawlerPluginFactory, PreparatorFactory

public abstract class PluggableFactory
extends Object

Loads and initializes the preparators.

Author:
Tilman Schneider, STZ-IDA an der FH Karlsruhe

Nested Class Summary
(package private) static class PluggableFactory.ExtensionFilter
           
 
Field Summary
protected static org.apache.log4j.Logger mLog
          The logger for this class
 
Constructor Summary
protected PluggableFactory()
           
 
Method Summary
 List<Pluggable> createPluggables(PreparatorSettings[] preparatorSettingsArr)
           
protected abstract  String[] getClassNames(File pluggableFile, Attributes attributes)
           
protected abstract  String getDefaultPackage()
           
protected abstract  File getPluggableDir()
           
private  boolean isPreparatorEnabled(String className, PreparatorSettings[] preparatorSettingsArr)
          Checks whether a preparator is enabled.
private  void loadPreparatorJar(File file, HashMap<String,Pluggable> preparatorHash, PreparatorSettings[] preparatorSettingsArr)
          Loads a preparator jar.
protected abstract  void pluggableAfterInit(Pluggable pluggable, PreparatorSettings preparatorSettings)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mLog

protected static org.apache.log4j.Logger mLog
The logger for this class

Constructor Detail

PluggableFactory

protected PluggableFactory()
Method Detail

createPluggables

public List<Pluggable> createPluggables(PreparatorSettings[] preparatorSettingsArr)
                                 throws RegainException
Throws:
RegainException

getPluggableDir

protected abstract File getPluggableDir()
                                 throws RegainException
Throws:
RegainException

pluggableAfterInit

protected abstract void pluggableAfterInit(Pluggable pluggable,
                                           PreparatorSettings preparatorSettings)
                                    throws RegainException
Throws:
RegainException

loadPreparatorJar

private void loadPreparatorJar(File file,
                               HashMap<String,Pluggable> preparatorHash,
                               PreparatorSettings[] preparatorSettingsArr)
                        throws RegainException
Loads a preparator jar.

Parameters:
file - The preparator jar to load.
preparatorHash - The hash where to add all loaded preparators.
preparatorSettingsArr - The preparator settings. Used to determine whether a preparator is enabled.
Throws:
RegainException - If loading the jar failed.

getDefaultPackage

protected abstract String getDefaultPackage()

getClassNames

protected abstract String[] getClassNames(File pluggableFile,
                                          Attributes attributes)
                                   throws RegainException
Throws:
RegainException

isPreparatorEnabled

private boolean isPreparatorEnabled(String className,
                                    PreparatorSettings[] preparatorSettingsArr)
Checks whether a preparator is enabled.

Parameters:
className - The class name of the preparator to check.
preparatorSettingsArr - The preparator settings to use to determine whether a preparator is enabled.
Returns:
Whether the preparator is enabled.

Regain 2.1.0-STABLE API

Regain 2.1.0-STABLE, Copyright (C) 2004-2010 Til Schneider, www.murfman.de, Thomas Tesche, www.clustersystems.info