@DisallowConcurrentExecution @PersistJobDataAfterExecution public class FileScanJob extends Object implements Job
FileScanListener that can be found in the
SchedulerContext.FileScanListener| Modifier and Type | Field and Description |
|---|---|
static String |
FILE_NAME
JobDataMap key with which to specify
the name of the file to monitor. |
static String |
FILE_SCAN_LISTENER_NAME
JobDataMap key with which to specify the
FileScanListener to be
notified when the file contents change. |
static String |
MINIMUM_UPDATE_AGE
JobDataMap key with which to specify a long
value that represents the minimum number of milliseconds that must have
past since the file's last modified time in order to consider the file
new/altered. |
| Constructor and Description |
|---|
FileScanJob() |
public static final String FILE_NAME
JobDataMap key with which to specify
the name of the file to monitor.public static final String FILE_SCAN_LISTENER_NAME
JobDataMap key with which to specify the
FileScanListener to be
notified when the file contents change.public static final String MINIMUM_UPDATE_AGE
JobDataMap key with which to specify a long
value that represents the minimum number of milliseconds that must have
past since the file's last modified time in order to consider the file
new/altered. This is necessary because another process may still be
in the middle of writing to the file when the scan occurs, and the
file may therefore not yet be ready for processing.
If this parameter is not specified, a default value of
5000 (five seconds) will be used.
public void execute(JobExecutionContext context) throws JobExecutionException
execute in interface JobJobExecutionExceptionJob.execute(org.quartz.JobExecutionContext)protected long getLastModifiedDate(String fileName)
Copyright 2001-2017, Terracotta, Inc.