To schedule the execution of the batch, we just need to modify the configuration file.
This batch will begin the 2006/08/02 at 15h00:
# MyBatchFramework configuration file (v. 1.0) mbf.batch.className = net.sf.mybatchfwk.test.BatchTest mbf.threadPool.minSize = 1 mbf.threadPool.maxSize = 2 mbf.threadPool.blockingQueueCapacity = 2 mbf.schedule.enable = true mbf.schedule.startDate = 2006/08/02 15:00:00 CEST #mbf.schedule.endDate = #mbf.schedule.periodTime = 5000 #mbf.schedule.numberOfLoop = 3
This batch will begin the 2006/08/02 at 15:00 and will end the 2006/08/03 at 15:00, so one day later. The execution method will be called every five minutes (periodTime=5*60*1000).
# MyBatchFramework configuration file (v. 1.0) mbf.batch.className = net.sf.mybatchfwk.test.BatchTest mbf.threadPool.minSize = 1 mbf.threadPool.maxSize = 2 mbf.threadPool.blockingQueueCapacity = 2 mbf.schedule.enable = true mbf.schedule.startDate = 2006/08/02 15:00:00 CEST mbf.schedule.endDate = 2006/08/03 15:00:00 CEST mbf.schedule.periodTime = 300000 #mbf.schedule.numberOfLoop = 3
The execution method of this batch will be called every five minutes, ten times.
# MyBatchFramework configuration file (v. 1.0) mbf.batch.className = net.sf.mybatchfwk.test.BatchTest mbf.threadPool.minSize = 1 mbf.threadPool.maxSize = 2 mbf.threadPool.blockingQueueCapacity = 2 mbf.schedule.enable = true #mbf.schedule.startDate = 2006/08/02 15:00:00 CEST #mbf.schedule.endDate = mbf.schedule.periodTime = 300000 mbf.schedule.numberOfLoop = 10