public void addPeriodJob(JobInfo jinfo, PeriodInfo pinfo, JobDataMap jdatamap) throws Exception
{
int repeat = pinfo.getRepeatCount();
Date start = pinfo.getStartTime();
JobInfo jobinfo = getJobInfo(jinfo);
if (start == null)
start = new Date();
if (repeat <= 0)
repeat = SimpleTrigger.REPEAT_INDEFINITELY;
else
repeat = repeat - 1;
SimpleTrigger trigger =
new SimpleTrigger(jobinfo.getJobName(), jobinfo.getGroupName(), start, pinfo.getEndTime(), repeat, pinfo
.getRepeatInterval());
JobDetail job = new JobDetail(jobinfo.getJobName(), jobinfo.getGroupName(), jobinfo.getJob());
job.setJobDataMap(jdatamap);
job.setDescription(jobinfo.getDescription());
scheduler_.scheduleJob(job, trigger);
}