public class ScriptedProcessor extends Processor implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
Modifier and Type | Field and Description |
---|---|
protected org.springframework.context.ApplicationContext |
appCtx |
protected String |
engineName
engine name; default "beanshell"
|
protected boolean |
isolateThreads
Whether each ToeThread should get its own independent script
engine, or they should share synchronized access to one
engine.
|
protected org.archive.io.ReadSource |
scriptSource |
protected ScriptEngine |
sharedEngine |
protected ThreadLocal<ScriptEngine> |
threadEngine |
Constructor and Description |
---|
ScriptedProcessor()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
protected ScriptEngine |
getEngine()
Get the proper ScriptEngine instance -- either shared or local
to this thread.
|
String |
getEngineName() |
boolean |
getIsolateThreads() |
org.archive.io.ReadSource |
getScriptSource() |
protected void |
innerProcess(CrawlURI curi)
Actually performs the process.
|
protected ScriptEngine |
newEngine()
Create a new
ScriptEngine instance, preloaded with any supplied
source file and the variables 'self' (this ScriptedProcessor ) and
'context' (the ApplicationContext ). |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setEngineName(String name) |
void |
setIsolateThreads(boolean isolateThreads) |
void |
setScriptSource(org.archive.io.ReadSource source) |
protected boolean |
shouldProcess(CrawlURI curi)
Determines whether the given uri should be processed by this
processor.
|
doCheckpoint, finishCheckpoint, flattenVia, fromCheckpointJson, getBeanName, getEnabled, getKeyedProperties, getRecordedSize, getShouldProcessRule, getURICount, hasHttpAuthenticationCredential, innerProcessResult, innerRejectProcess, isRunning, isSuccess, process, report, setBeanName, setEnabled, setRecoveryCheckpoint, setShouldProcessRule, start, startCheckpoint, stop, toCheckpointJson
protected String engineName
protected org.archive.io.ReadSource scriptSource
protected boolean isolateThreads
protected org.springframework.context.ApplicationContext appCtx
protected transient ThreadLocal<ScriptEngine> threadEngine
protected ScriptEngine sharedEngine
public String getEngineName()
public void setEngineName(String name)
public org.archive.io.ReadSource getScriptSource()
public void setScriptSource(org.archive.io.ReadSource source)
public boolean getIsolateThreads()
public void setIsolateThreads(boolean isolateThreads)
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
protected boolean shouldProcess(CrawlURI curi)
Processor
shouldProcess
in class Processor
curi
- the URI to testprotected void innerProcess(CrawlURI curi)
Processor
#ENABLED
, the
#DECIDE_RULES
and the #shouldProcess(ProcessorURI)
tests.innerProcess
in class Processor
curi
- the URI to processprotected ScriptEngine getEngine()
protected ScriptEngine newEngine()
ScriptEngine
instance, preloaded with any supplied
source file and the variables 'self' (this ScriptedProcessor
) and
'context' (the ApplicationContext
).Copyright © 2003-2014 Internet Archive. All Rights Reserved.