|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.quartz.jobs.FileScanJob
@DisallowConcurrentExecution @PersistJobDataAfterExecution public class FileScanJob
Inspects a file and compares whether it's "last modified date" has changed
since the last time it was inspected. If the file has been updated, the
job invokes a "call-back" method on an identified
FileScanListener
that can be found in the
SchedulerContext
.
FileScanListener
Field Summary | |
---|---|
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 Summary | |
---|---|
FileScanJob()
|
Method Summary | |
---|---|
void |
execute(JobExecutionContext context)
Called by the when a
fires that is associated with the Job . |
protected long |
getLastModifiedDate(String fileName)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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.
Constructor Detail |
---|
public FileScanJob()
Method Detail |
---|
public void execute(JobExecutionContext context) throws JobExecutionException
Job
Called by the
when a Scheduler
fires that is associated with the Trigger
Job
.
The implementation may wish to set a
result
object on the
JobExecutionContext
before this method exits. The result itself
is meaningless to Quartz, but may be informative to
or
JobListener
s
that are watching the job's
execution.
TriggerListener
s
execute
in interface Job
JobExecutionException
- if there is an exception while executing the job.Job.execute(org.quartz.JobExecutionContext)
protected long getLastModifiedDate(String fileName)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |