public class ActionDirectory extends Object implements org.springframework.context.ApplicationContextAware, org.springframework.context.Lifecycle, Runnable
Modifier and Type | Field and Description |
---|---|
protected ConfigPath |
actionDir |
protected org.springframework.context.ApplicationContext |
appCtx |
protected int |
delaySeconds
delay between scans of actionDirectory for new files
|
protected ConfigPath |
doneDir |
protected ScheduledExecutorService |
executor |
protected Frontier |
frontier
autowired frontier for actions
|
protected int |
initialDelaySeconds
how long after crawl start to first scan action directory
|
protected static ScriptEngineManager |
MANAGER
shared ScriptEngineManager
|
protected SeedModule |
seeds |
Constructor and Description |
---|
ActionDirectory() |
Modifier and Type | Method and Description |
---|---|
protected void |
actOn(File actionFile)
Process an individual action file found
|
ConfigPath |
getActionDir() |
int |
getDelaySeconds() |
ConfigPath |
getDoneDir() |
Frontier |
getFrontier() |
int |
getInitialDelaySeconds() |
SeedModule |
getSeeds() |
boolean |
isRunning() |
void |
run()
Action taken at scheduled intervals
|
protected void |
scanActionDirectory()
Find any new files in the 'action' directory; process each in
order.
|
void |
setActionDir(ConfigPath actionDir) |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setDelaySeconds(int delay) |
void |
setDoneDir(ConfigPath doneDir) |
void |
setFrontier(Frontier frontier) |
void |
setInitialDelaySeconds(int initialDelay) |
void |
setSeeds(SeedModule seeds) |
void |
start() |
void |
stop() |
protected boolean |
tryAsScript(File actionFile,
String timestamp)
Try the actionFile as a script, deducing the proper scripting
language from its file extension.
|
protected ScheduledExecutorService executor
protected int initialDelaySeconds
protected int delaySeconds
protected ConfigPath actionDir
protected ConfigPath doneDir
protected org.springframework.context.ApplicationContext appCtx
protected SeedModule seeds
protected Frontier frontier
protected static ScriptEngineManager MANAGER
public int getInitialDelaySeconds()
public void setInitialDelaySeconds(int initialDelay)
public int getDelaySeconds()
public void setDelaySeconds(int delay)
public ConfigPath getActionDir()
public void setActionDir(ConfigPath actionDir)
public ConfigPath getDoneDir()
public void setDoneDir(ConfigPath doneDir)
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 SeedModule getSeeds()
public void setSeeds(SeedModule seeds)
public Frontier getFrontier()
public void setFrontier(Frontier frontier)
public boolean isRunning()
isRunning
in interface org.springframework.context.Lifecycle
public void start()
start
in interface org.springframework.context.Lifecycle
public void stop()
stop
in interface org.springframework.context.Lifecycle
public void run()
run
in interface Runnable
Runnable.run()
protected void scanActionDirectory()
protected void actOn(File actionFile)
actionFile
- File to processprotected boolean tryAsScript(File actionFile, String timestamp)
actionFile
- file to trytimestamp
- timestamp correlating out/ex files with done scriptCopyright © 2003-2014 Internet Archive. All Rights Reserved.