| org.archive.crawler.deciderules.DecideRule org.archive.crawler.deciderules.BeanShellDecideRule
BeanShellDecideRule | public class BeanShellDecideRule extends DecideRule (Code) | | Rule which runs a groovy script to make its decision.
Script source may be provided via a file local to the crawler.
Variables available to the script include 'object' (the object to be
evaluated, typically a CandidateURI or CrawlURI), 'self'
(this GroovyDecideRule instance), and 'controller' (the crawl's
CrawlController instance).
TODO: reduce copy & paste with GroovyProcessor
author: gojomo |
Method Summary | |
public synchronized Object | decisionFor(Object object) | protected Interpreter | getInterpreter() Get the proper Interpreter instance -- either shared or local
to this thread. | public void | kickUpdate() Setup (or reset) Intepreter variables, as appropraite based on
thread-isolation setting. | protected Interpreter | newInterpreter() Create a new Interpreter instance, preloaded with any supplied
source file and the variables 'self' (this
BeanShellProcessor) and 'controller' (the CrawlController). |
ATTR_ISOLATE_THREADS | final public static String ATTR_ISOLATE_THREADS(Code) | | whether each thread should have its own script runner (true), or
they should share a single script runner with synchronized access
|
ATTR_SCRIPT_FILE | final public static String ATTR_SCRIPT_FILE(Code) | | setting for script file
|
initialized | protected boolean initialized(Code) | | |
sharedInterpreter | protected Interpreter sharedInterpreter(Code) | | |
BeanShellDecideRule | public BeanShellDecideRule(String name)(Code) | | |
getInterpreter | protected Interpreter getInterpreter()(Code) | | Get the proper Interpreter instance -- either shared or local
to this thread.
Interpreter to use |
kickUpdate | public void kickUpdate()(Code) | | Setup (or reset) Intepreter variables, as appropraite based on
thread-isolation setting.
|
newInterpreter | protected Interpreter newInterpreter()(Code) | | Create a new Interpreter instance, preloaded with any supplied
source file and the variables 'self' (this
BeanShellProcessor) and 'controller' (the CrawlController).
the new Interpreter instance |
|
|