xsmeral.semnet.scraper
Class ScraperWrapper

java.lang.Object
  extended by xsmeral.pipe.AbstractObjectProcessor
      extended by xsmeral.pipe.LocalObjectFilter<EntityDocument,Statement>
          extended by xsmeral.semnet.scraper.ScraperWrapper
All Implemented Interfaces:
Runnable, xsmeral.pipe.context.ContextAware, xsmeral.pipe.interfaces.ObjectProcessor, xsmeral.pipe.interfaces.ObjectSink<EntityDocument>, xsmeral.pipe.interfaces.ObjectSource<Statement>

@ObjectProcessorInterface(in=EntityDocument.class,
                          out=org.openrdf.model.Statement.class)
public class ScraperWrapper
extends xsmeral.pipe.LocalObjectFilter<EntityDocument,Statement>

This processor works as a router, dispatching entity documents to scrapers. The scrapers are configured from a HostManager instance and pre-instantiated at post-context initialization.

See Also:
HostManager
Context parameters required
hostManager - A HostManager instance, used to instantiate scrapers

Nested Class Summary
 
Nested classes/interfaces inherited from interface xsmeral.pipe.interfaces.ObjectProcessor
xsmeral.pipe.interfaces.ObjectProcessor.Status
 
Field Summary
 
Fields inherited from class xsmeral.pipe.AbstractObjectProcessor
canStart, context, status
 
Constructor Summary
ScraperWrapper()
           
 
Method Summary
 boolean canStart()
           
protected  void handleStoppedSink()
           
protected  void handleStoppedSource()
           
protected  void initPostContext()
          Instantiates scrapers.
protected  void preRun()
          Starts scrapers.
protected  void process()
           
 
Methods inherited from class xsmeral.pipe.LocalObjectFilter
getNext, getOutBuffer, getPrev, next, prev, read, requestStop, setNext, setOutBuffer, write
 
Methods inherited from class xsmeral.pipe.AbstractObjectProcessor
failStart, failStart, failStart, getContext, getInType, getOutType, getParams, getStatus, initContext, initContextSet, initialize, initializeInternal, initWithContext, postRun, run, setContext, stop, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface xsmeral.pipe.interfaces.ObjectSink
getInType
 
Methods inherited from interface xsmeral.pipe.interfaces.ObjectSource
getOutType
 

Constructor Detail

ScraperWrapper

public ScraperWrapper()
Method Detail

initPostContext

protected void initPostContext()
Instantiates scrapers.

Overrides:
initPostContext in class xsmeral.pipe.AbstractObjectProcessor

preRun

protected void preRun()
               throws xsmeral.pipe.ProcessorStoppedException
Starts scrapers.

Overrides:
preRun in class xsmeral.pipe.AbstractObjectProcessor
Throws:
xsmeral.pipe.ProcessorStoppedException

process

protected void process()
                throws xsmeral.pipe.ProcessorStoppedException
Overrides:
process in class xsmeral.pipe.LocalObjectFilter<EntityDocument,Statement>
Throws:
xsmeral.pipe.ProcessorStoppedException

canStart

public boolean canStart()
Specified by:
canStart in interface xsmeral.pipe.interfaces.ObjectProcessor
Overrides:
canStart in class xsmeral.pipe.AbstractObjectProcessor

handleStoppedSink

protected void handleStoppedSink()
Overrides:
handleStoppedSink in class xsmeral.pipe.LocalObjectFilter<EntityDocument,Statement>

handleStoppedSource

protected void handleStoppedSource()
Overrides:
handleStoppedSource in class xsmeral.pipe.LocalObjectFilter<EntityDocument,Statement>