示例:我已经将工作安排在下午4点,但是当我计划(下午3:30)工作时,它将立即执行。为什么立即触发。我是否会错过“属性”中的任何内容以在给定的计划时间执行。请帮助我。我使用简单的触发器来执行。
Properties FIle:
----------------
Properties properties = new Properties();
properties.put("org.quartz.scheduler.instanceId", "AUTO");
properties.put("org.quartz.scheduler.instanceName", "Platform_Scheduler");
properties.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool");
properties.put("org.quartz.threadPool.threadCount", quartzThreadCount);
properties.put("org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread", "true");
//specify the jobstore
properties.put("org.quartz.jobStore.class", "org.quartz.impl.jdbcjobstore.JobStoreTX");
properties.put("org.quartz.jobStore.driverDelegateClass", "org.quartz.impl.jdbcjobstore.StdJDBCDelegate");
properties.put("org.quartz.jobStore.useProperties", "true");
properties.put("org.quartz.jobStore.isClustered", "true");
properties.put("org.quartz.jobStore.clusterCheckinInterval", "20000");
//The datasource for the jobstore
properties.put("org.quartz.jobStore.dataSource","IPDS");
//Quartz table prefixes in the database
properties.put("org.quartz.jobStore.tablePrefix", "QRTZ_");
properties.put("org.quartz.jobStore.misfireThreshold", quartzMisfireThreshold);
//The details of the datasource
properties.put("org.quartz.dataSource.IPDS.driver", quartzDriverClass);
properties.put("org.quartz.dataSource.IPDS.URL", quartzUrl);
properties.put("org.quartz.dataSource.IPDS.user", quartzUsername);
properties.put("org.quartz.dataSource.IPDS.password", quartzPassword);
properties.put("org.quartz.dataSource.IPDS.maxConnections", "20");
Simple Trigger Code:
---------------------------
SimpleTrigger tb = (SimpleTrigger) newTrigger()
.startAt(start) // some Date .withSchedule(SimpleScheduleBuilder.simpleSchedule().withRepeatCount(0).withMisfireHandlingInstructionIgnoreMisfires())
.build();