private void runJob(final CronJob cronJob) throws IOException { final Element elementJob = cronJob.getElement(); final Element element = ((elementJob == null) ? fabricateElement(cronJob) : elementJob); final CronJob cronJob1 = new CronJob(cronJob.getName(), cronJob.isEnabled(), cronJob.getLine(), element); final Properties properties = CronProperties.getProperties(); final String className = properties.getProperty(element.getLocalName()); if (className != null) { runJob(cronJob1, className); } }
private void runJob(final CronJob cronJob, final String className) { final CronTab cronTab = executor.getCronTab(); final ExecutorService executorService = executor.getExecutorService(); final CronParams params = getParams(dateSchedule, cronJob); final CronRunnable runnable = getRunnable(className, params); if (runnable != null) { logger.info( String.format("execute(%s/%s)", cronTab.getName(), cronJob.getName())); // i18n log executorService.execute(runnable); } }
private RowTyped createRow(final Date date, final CronJob cronJob) { final RowSet rowSet = executor.getRowSet(); final Row row = new InsertRow(rowSet).getRow(); rowSet.add(row); final RowTyped rowTyped = new RowTyped(rowSet.getMetaData(), row); rowTyped.update("cronTab", executor.getCronTab().getName()); // i18n metadata rowTyped.update("cronJob", cronJob.getName()); // i18n metadata rowTyped.update("command", cronJob.getLine()); // i18n metadata rowTyped.update( "principal", ((invokerPrincipal == null) ? null : invokerPrincipal.getName())); // i18n meta rowTyped.update("date", date); // i18n metadata return rowTyped; }