/** * The file name (and path) to the XML file that should be read. * @deprecated Use fileNames with just one file. */ public void setFileName(String fileName) { getLog().warn("The \"filename\" plugin property is deprecated. Please use \"filenames\" in the future."); this.fileNames = fileName; }
/** * @see org.quartz.jobs.FileScanListener#fileUpdated(java.lang.String) */ public void fileUpdated(String fileName) { if (started) { processFile(fileName); } }
private void processFile(JobFile jobFile) { if (jobFile == null || !jobFile.getFileFound()) { return; } JobSchedulingDataProcessor processor = new JobSchedulingDataProcessor(this.classLoadHelper, isValidating(), isValidatingSchema()); try { processor.processFileAndScheduleJobs( jobFile.getFileName(), jobFile.getFileName(), // systemId getScheduler(), isOverWriteExistingJobs()); } catch (Exception e) { getLog().error("Error scheduling jobs: " + e.getMessage(), e); } }
getScheduler().getContext().put(JOB_INITIALIZATION_PLUGIN_NAME + '_' + getName(), this); String jobTriggerName = buildJobTriggerName(jobFile.getFileBasename()); job.setVolatility(true); job.getJobDataMap().put(FileScanJob.FILE_NAME, jobFile.getFileName()); job.getJobDataMap().put(FileScanJob.FILE_SCAN_LISTENER_NAME, JOB_INITIALIZATION_PLUGIN_NAME + '_' + getName()); getScheduler().scheduleJob(job, trig); processFile(jobFile); getLog().error("Error starting background-task for watching jobs file.", se); } finally { started = true;
String jobTriggerName = JOB_INITIALIZATION_PLUGIN_NAME + '_' + getName() + '_' + fileBasename.replace('.', '_');
if (isFailOnFileNotFound()) { throw new SchedulerException( "File named '" + getFileName() + "' does not exist.");
private void processFile(JobFile jobFile) { if (jobFile == null || !jobFile.getFileFound()) { return; } JobSchedulingDataProcessor processor = new JobSchedulingDataProcessor(this.classLoadHelper, isValidating(), isValidatingSchema()); try { processor.processFileAndScheduleJobs( jobFile.getFileName(), jobFile.getFileName(), // systemId getScheduler(), isOverWriteExistingJobs()); } catch (Exception e) { getLog().error("Error scheduling jobs: " + e.getMessage(), e); } }
getScheduler().getContext().put(JOB_INITIALIZATION_PLUGIN_NAME + '_' + getName(), this); String jobTriggerName = buildJobTriggerName(jobFile.getFileBasename()); job.setVolatility(true); job.getJobDataMap().put(FileScanJob.FILE_NAME, jobFile.getFileName()); job.getJobDataMap().put(FileScanJob.FILE_SCAN_LISTENER_NAME, JOB_INITIALIZATION_PLUGIN_NAME + '_' + getName()); getScheduler().scheduleJob(job, trig); processFile(jobFile); getLog().error("Error starting background-task for watching jobs file.", se); } finally { started = true;
String jobTriggerName = JOB_INITIALIZATION_PLUGIN_NAME + '_' + getName() + '_' + fileBasename.replace('.', '_');
if (isFailOnFileNotFound()) { throw new SchedulerException( "File named '" + getFileName() + "' does not exist.");
/** * @see org.quartz.jobs.FileScanListener#fileUpdated(java.lang.String) */ public void fileUpdated(String fileName) { if (started) { processFile(fileName); } }
/** * The file name (and path) to the XML file that should be read. * @deprecated Use fileNames with just one file. */ public void setFileName(String fileName) { getLog().warn("The \"filename\" plugin property is deprecated. Please use \"filenames\" in the future."); this.fileNames = fileName; }
public void processFile(String filePath) { processFile((JobFile)jobFiles.get(filePath)); }
/** * <p> * Called during creation of the <code>Scheduler</code> in order to give * the <code>SchedulerPlugin</code> a chance to initialize. * </p> * * @throws org.quartz.SchedulerConfigException * if there is an error initializing. */ public void initialize(String name, final Scheduler scheduler) throws SchedulerException { super.initialize(name, scheduler); classLoadHelper = new CascadingClassLoadHelper(); classLoadHelper.initialize(); getLog().info("Registering Quartz Job Initialization Plug-in."); // Create JobFile objects StringTokenizer stok = new StringTokenizer(fileNames, FILE_NAME_DELIMITERS); while (stok.hasMoreTokens()) { final String fileName = stok.nextToken(); final JobFile jobFile = new JobFile(fileName); jobFiles.put(fileName, jobFile); } }
public void processFile(String filePath) { processFile((JobFile)jobFiles.get(filePath)); }
/** * <p> * Called during creation of the <code>Scheduler</code> in order to give * the <code>SchedulerPlugin</code> a chance to initialize. * </p> * * @throws org.quartz.SchedulerConfigException * if there is an error initializing. */ public void initialize(String name, final Scheduler scheduler) throws SchedulerException { super.initialize(name, scheduler); classLoadHelper = new CascadingClassLoadHelper(); classLoadHelper.initialize(); getLog().info("Registering Quartz Job Initialization Plug-in."); // Create JobFile objects StringTokenizer stok = new StringTokenizer(fileNames, FILE_NAME_DELIMITERS); while (stok.hasMoreTokens()) { final String fileName = stok.nextToken(); final JobFile jobFile = new JobFile(fileName); jobFiles.put(fileName, jobFile); } }