|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.management.Attribute org.archive.crawler.settings.Type org.archive.crawler.settings.ComplexType org.archive.crawler.settings.ModuleType org.archive.crawler.framework.Processor org.archive.crawler.processor.BeanShellProcessor
public class BeanShellProcessor
A processor which runs a BeanShell script on the CrawlURI. Script source may be provided via a file local to the crawler. Script source should define a method with one argument, 'run(curi)'. Each processed CrawlURI is passed to this script method. Other variables available to the script include 'self' (this BeanShellProcessor instance) and 'controller' (the crawl's CrawlController instance).
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.archive.crawler.settings.ComplexType |
---|
ComplexType.MBeanAttributeInfoIterator |
Field Summary | |
---|---|
static java.lang.String |
ATTR_ISOLATE_THREADS
whether each thread should have its own script runner (true), or they should share a single script runner with synchronized access |
static java.lang.String |
ATTR_SCRIPT_FILE
setting for script file |
protected bsh.Interpreter |
sharedInterpreter
|
java.util.Map<java.lang.Object,java.lang.Object> |
sharedMap
|
protected java.lang.ThreadLocal<bsh.Interpreter> |
threadInterpreter
|
Fields inherited from class org.archive.crawler.framework.Processor |
---|
ATTR_DECIDE_RULES, ATTR_ENABLED, attrDecideRules |
Fields inherited from class org.archive.crawler.settings.ComplexType |
---|
definition, definitionMap |
Constructor Summary | |
---|---|
BeanShellProcessor(java.lang.String name)
Constructor. |
Method Summary | |
---|---|
protected bsh.Interpreter |
getInterpreter()
Get the proper Interpreter instance -- either shared or local to this thread. |
protected void |
initialTasks()
Classes subclassing this one should override this method to perform processor specific actions. |
protected void |
innerProcess(CrawlURI curi)
Classes subclassing this one should override this method to perform their custom actions on the CrawlURI. |
void |
kickUpdate()
Setup (or reset) Intepreter variables, as appropraite based on thread-isolation setting. |
protected bsh.Interpreter |
newInterpreter()
Create a new Interpreter instance, preloaded with any supplied source code or source file and the variables 'self' (this BeanShellProcessor) and 'controller' (the CrawlController). |
Methods inherited from class org.archive.crawler.framework.Processor |
---|
checkForInterrupt, finalTasks, getController, getDecideRule, getDefaultNextProcessor, innerRejectProcess, isContentToProcess, isEnabled, isExpectedMimeType, isHttpTransactionContentToProcess, process, report, rulesAccept, rulesAccept, setDefaultNextProcessor, spawn |
Methods inherited from class org.archive.crawler.settings.ModuleType |
---|
addElement, listUsedFiles |
Methods inherited from class org.archive.crawler.settings.Type |
---|
addConstraint, equals, getConstraints, getLegalValueType, isExpertSetting, isOverrideable, isTransient, setExpertSetting, setLegalValueType, setOverrideable, setTransient |
Methods inherited from class javax.management.Attribute |
---|
getName, hashCode |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ATTR_SCRIPT_FILE
public static final java.lang.String ATTR_ISOLATE_THREADS
protected java.lang.ThreadLocal<bsh.Interpreter> threadInterpreter
protected bsh.Interpreter sharedInterpreter
public java.util.Map<java.lang.Object,java.lang.Object> sharedMap
Constructor Detail |
---|
public BeanShellProcessor(java.lang.String name)
name
- Name of this processor.Method Detail |
---|
protected void innerProcess(CrawlURI curi)
Processor
innerProcess
in class Processor
curi
- The CrawlURI being processed.protected bsh.Interpreter getInterpreter()
protected bsh.Interpreter newInterpreter()
protected void initialTasks()
Processor
This method is garanteed to be called after the crawl is set up, but before any URI-processing has occured.
initialTasks
in class Processor
public void kickUpdate()
kickUpdate
in class Processor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |