當前位置: 首頁>>代碼示例>>Java>>正文


Java SimpleTrigger.setRepeatInterval方法代碼示例

本文整理匯總了Java中org.quartz.SimpleTrigger.setRepeatInterval方法的典型用法代碼示例。如果您正苦於以下問題:Java SimpleTrigger.setRepeatInterval方法的具體用法?Java SimpleTrigger.setRepeatInterval怎麽用?Java SimpleTrigger.setRepeatInterval使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.quartz.SimpleTrigger的用法示例。


在下文中一共展示了SimpleTrigger.setRepeatInterval方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: buildIndexHtml

import org.quartz.SimpleTrigger; //導入方法依賴的package包/類
public void buildIndexHtml() {
	try {
		SimpleTrigger simpleTrigger = new SimpleTrigger();
		simpleTrigger.setName(BuildIndexHtmlJob.TRIGGER_NAME);
		simpleTrigger.setGroup(BuildIndexHtmlJob.GROUP_NAME);
		simpleTrigger.setJobName(BuildIndexHtmlJob.JOB_NAME);
		simpleTrigger.setJobGroup(BuildIndexHtmlJob.GROUP_NAME);
		simpleTrigger.setStartTime(DateUtils.addSeconds(new Date(), SettingUtil.getSetting().getBuildHtmlDelayTime()));
		simpleTrigger.setRepeatCount(0);
		simpleTrigger.setRepeatInterval(60);
		
		JobDetail jobDetail = scheduler.getJobDetail(BuildIndexHtmlJob.JOB_NAME, BuildIndexHtmlJob.GROUP_NAME);
		if (jobDetail != null) {
			scheduler.rescheduleJob(BuildIndexHtmlJob.TRIGGER_NAME, BuildIndexHtmlJob.GROUP_NAME, simpleTrigger);
		} else {
			jobDetail = new JobDetail(BuildIndexHtmlJob.JOB_NAME, BuildIndexHtmlJob.GROUP_NAME, BuildIndexHtmlJob.class);
			scheduler.scheduleJob(jobDetail, simpleTrigger);
		}
		
		if (scheduler.isShutdown()) {
			scheduler.start();
		}
	} catch (SchedulerException e) {
		e.printStackTrace();
	}
}
 
開發者ID:wangko27,項目名稱:SelfSoftShop,代碼行數:27,代碼來源:JobServiceImpl.java

示例2: buildLoginHtml

import org.quartz.SimpleTrigger; //導入方法依賴的package包/類
public void buildLoginHtml() {
	try {
		SimpleTrigger simpleTrigger = new SimpleTrigger();
		simpleTrigger.setName(BuildLoginHtmlJob.TRIGGER_NAME);
		simpleTrigger.setGroup(BuildLoginHtmlJob.GROUP_NAME);
		simpleTrigger.setJobName(BuildLoginHtmlJob.JOB_NAME);
		simpleTrigger.setJobGroup(BuildLoginHtmlJob.GROUP_NAME);
		simpleTrigger.setStartTime(DateUtils.addSeconds(new Date(), SettingUtil.getSetting().getBuildHtmlDelayTime()));
		simpleTrigger.setRepeatCount(0);
		simpleTrigger.setRepeatInterval(60);
		
		JobDetail jobDetail = scheduler.getJobDetail(BuildLoginHtmlJob.JOB_NAME, BuildLoginHtmlJob.GROUP_NAME);
		if (jobDetail != null) {
			scheduler.rescheduleJob(BuildLoginHtmlJob.TRIGGER_NAME, BuildLoginHtmlJob.GROUP_NAME, simpleTrigger);
		} else {
			jobDetail = new JobDetail(BuildLoginHtmlJob.JOB_NAME, BuildLoginHtmlJob.GROUP_NAME, BuildLoginHtmlJob.class);
			scheduler.scheduleJob(jobDetail, simpleTrigger);
		}
		
		if (scheduler.isShutdown()) {
			scheduler.start();
		}
	} catch (SchedulerException e) {
		e.printStackTrace();
	}
}
 
開發者ID:wangko27,項目名稱:SelfSoftShop,代碼行數:27,代碼來源:JobServiceImpl.java

示例3: buildRegisterAgreementHtml

import org.quartz.SimpleTrigger; //導入方法依賴的package包/類
public void buildRegisterAgreementHtml() {
	try {
		SimpleTrigger simpleTrigger = new SimpleTrigger();
		simpleTrigger.setName(BuildRegisterAgreementHtmlJob.TRIGGER_NAME);
		simpleTrigger.setGroup(BuildRegisterAgreementHtmlJob.GROUP_NAME);
		simpleTrigger.setJobName(BuildRegisterAgreementHtmlJob.JOB_NAME);
		simpleTrigger.setJobGroup(BuildRegisterAgreementHtmlJob.GROUP_NAME);
		simpleTrigger.setStartTime(DateUtils.addSeconds(new Date(), SettingUtil.getSetting().getBuildHtmlDelayTime()));
		simpleTrigger.setRepeatCount(0);
		simpleTrigger.setRepeatInterval(60);
		
		JobDetail jobDetail = scheduler.getJobDetail(BuildRegisterAgreementHtmlJob.JOB_NAME, BuildRegisterAgreementHtmlJob.GROUP_NAME);
		if (jobDetail != null) {
			scheduler.rescheduleJob(BuildRegisterAgreementHtmlJob.TRIGGER_NAME, BuildRegisterAgreementHtmlJob.GROUP_NAME, simpleTrigger);
		} else {
			jobDetail = new JobDetail(BuildRegisterAgreementHtmlJob.JOB_NAME, BuildRegisterAgreementHtmlJob.GROUP_NAME, BuildRegisterAgreementHtmlJob.class);
			scheduler.scheduleJob(jobDetail, simpleTrigger);
		}
		
		if (scheduler.isShutdown()) {
			scheduler.start();
		}
	} catch (SchedulerException e) {
		e.printStackTrace();
	}
}
 
開發者ID:wangko27,項目名稱:SelfSoftShop,代碼行數:27,代碼來源:JobServiceImpl.java

示例4: buildAdminJs

import org.quartz.SimpleTrigger; //導入方法依賴的package包/類
public void buildAdminJs() {
	try {
		SimpleTrigger simpleTrigger = new SimpleTrigger();
		simpleTrigger.setName(BuildAdminJsJob.TRIGGER_NAME);
		simpleTrigger.setGroup(BuildAdminJsJob.GROUP_NAME);
		simpleTrigger.setJobName(BuildAdminJsJob.JOB_NAME);
		simpleTrigger.setJobGroup(BuildAdminJsJob.GROUP_NAME);
		simpleTrigger.setStartTime(DateUtils.addSeconds(new Date(), SettingUtil.getSetting().getBuildHtmlDelayTime()));
		simpleTrigger.setRepeatCount(0);
		simpleTrigger.setRepeatInterval(60);
		
		JobDetail jobDetail = scheduler.getJobDetail(BuildAdminJsJob.JOB_NAME, BuildAdminJsJob.GROUP_NAME);
		if (jobDetail != null) {
			scheduler.rescheduleJob(BuildAdminJsJob.TRIGGER_NAME, BuildAdminJsJob.GROUP_NAME, simpleTrigger);
		} else {
			jobDetail = new JobDetail(BuildAdminJsJob.JOB_NAME, BuildAdminJsJob.GROUP_NAME, BuildAdminJsJob.class);
			scheduler.scheduleJob(jobDetail, simpleTrigger);
		}
		
		if (scheduler.isShutdown()) {
			scheduler.start();
		}
	} catch (SchedulerException e) {
		e.printStackTrace();
	}
}
 
開發者ID:wangko27,項目名稱:SelfSoftShop,代碼行數:27,代碼來源:JobServiceImpl.java

示例5: buildShopJs

import org.quartz.SimpleTrigger; //導入方法依賴的package包/類
public void buildShopJs() {
	try {
		SimpleTrigger simpleTrigger = new SimpleTrigger();
		simpleTrigger.setName(BuildShopJsJob.TRIGGER_NAME);
		simpleTrigger.setGroup(BuildShopJsJob.GROUP_NAME);
		simpleTrigger.setJobName(BuildShopJsJob.JOB_NAME);
		simpleTrigger.setJobGroup(BuildShopJsJob.GROUP_NAME);
		simpleTrigger.setStartTime(DateUtils.addSeconds(new Date(), SettingUtil.getSetting().getBuildHtmlDelayTime()));
		simpleTrigger.setRepeatCount(0);
		simpleTrigger.setRepeatInterval(60);
		
		JobDetail jobDetail = scheduler.getJobDetail(BuildShopJsJob.JOB_NAME, BuildShopJsJob.GROUP_NAME);
		if (jobDetail != null) {
			scheduler.rescheduleJob(BuildShopJsJob.TRIGGER_NAME, BuildShopJsJob.GROUP_NAME, simpleTrigger);
		} else {
			jobDetail = new JobDetail(BuildShopJsJob.JOB_NAME, BuildShopJsJob.GROUP_NAME, BuildShopJsJob.class);
			scheduler.scheduleJob(jobDetail, simpleTrigger);
		}
		
		if (scheduler.isShutdown()) {
			scheduler.start();
		}
	} catch (SchedulerException e) {
		e.printStackTrace();
	}
}
 
開發者ID:wangko27,項目名稱:SelfSoftShop,代碼行數:27,代碼來源:JobServiceImpl.java

示例6: buildErrorHtml

import org.quartz.SimpleTrigger; //導入方法依賴的package包/類
public void buildErrorHtml() {
	try {
		SimpleTrigger simpleTrigger = new SimpleTrigger();
		simpleTrigger.setName(BuildErrorHtmlJob.TRIGGER_NAME);
		simpleTrigger.setGroup(BuildErrorHtmlJob.GROUP_NAME);
		simpleTrigger.setJobName(BuildErrorHtmlJob.JOB_NAME);
		simpleTrigger.setJobGroup(BuildErrorHtmlJob.GROUP_NAME);
		simpleTrigger.setStartTime(DateUtils.addSeconds(new Date(), SettingUtil.getSetting().getBuildHtmlDelayTime()));
		simpleTrigger.setRepeatCount(0);
		simpleTrigger.setRepeatInterval(60);
		
		JobDetail jobDetail = scheduler.getJobDetail(BuildErrorHtmlJob.JOB_NAME, BuildErrorHtmlJob.GROUP_NAME);
		if (jobDetail != null) {
			scheduler.rescheduleJob(BuildErrorHtmlJob.TRIGGER_NAME, BuildErrorHtmlJob.GROUP_NAME, simpleTrigger);
		} else {
			jobDetail = new JobDetail(BuildErrorHtmlJob.JOB_NAME, BuildErrorHtmlJob.GROUP_NAME, BuildErrorHtmlJob.class);
			scheduler.scheduleJob(jobDetail, simpleTrigger);
		}
		
		if (scheduler.isShutdown()) {
			scheduler.start();
		}
	} catch (SchedulerException e) {
		e.printStackTrace();
	}
}
 
開發者ID:wangko27,項目名稱:SelfSoftShop,代碼行數:27,代碼來源:JobServiceImpl.java

示例7: deleteProjectDetailJob

import org.quartz.SimpleTrigger; //導入方法依賴的package包/類
/**
 * Job to delete project details
 *
 * @author Adelina
 * 
 * @throws SchedulerException
 */
private void deleteProjectDetailJob() throws SchedulerException {
	logger.debug("deleteProjectDetailJob - START-");
	
	final String myJob = "DeleteProjectDetailJob";
	
	Scheduler sched = (Scheduler)CMContext.getFromContext(IConstant.SCHEDULER);
	
	JobDetail jobDetail = new JobDetail(myJob, myJob.concat("_Group"), DeleteProjectDetailJob.class);
    
    // initiate SimpleTrigger with its name(myJob.concat("Trigger")) and group name(myJob.concat("_Group"))
    SimpleTrigger simpleTrigger = new SimpleTrigger(myJob.concat("Trigger"), myJob.concat("_Group"));
    // set its start up time - now
    simpleTrigger.setStartTime(new Date(System.currentTimeMillis()));
    // set the interval, how often the job should run (3600 second here - 60 minutes = 1h) - must be set 
    simpleTrigger.setRepeatInterval(3600000);  
    // set the number of execution of this job
    // it will run 1 time and exhaust.
    simpleTrigger.setRepeatCount(0);
    
    sched.scheduleJob(jobDetail, simpleTrigger);
	
	logger.debug("deleteProjectDetailJob - END-");
}
 
開發者ID:CodeSphere,項目名稱:termitaria,代碼行數:31,代碼來源:InitApplication.java

示例8: deleteTeamMemberDetailJob

import org.quartz.SimpleTrigger; //導入方法依賴的package包/類
/**
 * Job to delete team member details
 *
 * @author Adelina
 * 
 * @throws SchedulerException
 */
private void deleteTeamMemberDetailJob() throws SchedulerException {
	logger.debug("deleteTeamMemberDetailJob - START-");
	
	final String myJob = "DeleteTeamMemberDetailJob";
	
	Scheduler sched = (Scheduler)CMContext.getFromContext(IConstant.SCHEDULER);
	
	JobDetail jobDetail = new JobDetail(myJob, myJob.concat("_Group"), DeleteTeamMemberDetailJob.class);
    
    // initiate SimpleTrigger with its name(myJob.concat("Trigger")) and group name(myJob.concat("_Group"))
    SimpleTrigger simpleTrigger = new SimpleTrigger(myJob.concat("Trigger"), myJob.concat("_Group"));
    // set its start up time - now
    simpleTrigger.setStartTime(new Date(System.currentTimeMillis()));
    // set the interval, how often the job should run (3600 second here - 60 minutes = 1h) - must be set 
    simpleTrigger.setRepeatInterval(3600000);  
    // set the number of execution of this job
    // it will run 1 time and exhaust.
    simpleTrigger.setRepeatCount(0);
    
    sched.scheduleJob(jobDetail, simpleTrigger);
	
	logger.debug("deleteTeamMemberDetailJob - END-");
}
 
開發者ID:CodeSphere,項目名稱:termitaria,代碼行數:31,代碼來源:InitApplication.java

示例9: finishProjectDetailJob

import org.quartz.SimpleTrigger; //導入方法依賴的package包/類
/**
 * Creates the finish project details job
 *
 * @author Adelina
 * 
 * @throws SchedulerException
 */
private void finishProjectDetailJob() throws SchedulerException {
	logger.debug("finishProjectDetailJob - START-");
	
	final String myJob = "FinishProjectDetailJob";
	
	Scheduler sched = (Scheduler)CMContext.getFromContext(IConstant.SCHEDULER);
	
	JobDetail jobDetail = new JobDetail(myJob, myJob.concat("_Group"), FinishProjectDetailJob.class);
    
    // initiate SimpleTrigger with its name(myJob.concat("Trigger")) and group name(myJob.concat("_Group"))
    SimpleTrigger simpleTrigger = new SimpleTrigger(myJob.concat("Trigger"), myJob.concat("_Group"));
    // set its start up time - now
    simpleTrigger.setStartTime(new Date(System.currentTimeMillis()));
    // set the interval, how often the job should run (3600 second here - 60 minutes = 1h) - must be set 
    simpleTrigger.setRepeatInterval(3600000);  
    // set the number of execution of this job
    // it will run 1 time and exhaust.
    simpleTrigger.setRepeatCount(0);
    
    sched.scheduleJob(jobDetail, simpleTrigger);
	
	logger.debug("finishProjectDetailJob - END-");
}
 
開發者ID:CodeSphere,項目名稱:termitaria,代碼行數:31,代碼來源:InitApplication.java

示例10: abortProjectDetailJob

import org.quartz.SimpleTrigger; //導入方法依賴的package包/類
/**
 * Creates the abort project details job
 *
 * @author Adelina
 * 
 * @throws SchedulerException
 */
private void abortProjectDetailJob() throws SchedulerException {
	logger.debug("abortProjectDetailJob - START-");
	
	final String myJob = "AbortProjectDetailJob";
	
	Scheduler sched = (Scheduler)CMContext.getFromContext(IConstant.SCHEDULER);
	
	JobDetail jobDetail = new JobDetail(myJob, myJob.concat("_Group"), AbortProjectDetailJob.class);
    
    // initiate SimpleTrigger with its name(myJob.concat("Trigger")) and group name(myJob.concat("_Group"))
    SimpleTrigger simpleTrigger = new SimpleTrigger(myJob.concat("Trigger"), myJob.concat("_Group"));
    // set its start up time - now
    simpleTrigger.setStartTime(new Date(System.currentTimeMillis()));
    // set the interval, how often the job should run (3600 second here - 60 minutes = 1h) - must be set 
    simpleTrigger.setRepeatInterval(3600000);  
    // set the number of execution of this job
    // it will run 1 time and exhaust.
    simpleTrigger.setRepeatCount(0);
    
    sched.scheduleJob(jobDetail, simpleTrigger);
	
	logger.debug("abortProjectDetailJob - END-");
}
 
開發者ID:CodeSphere,項目名稱:termitaria,代碼行數:31,代碼來源:InitApplication.java

示例11: openProjectDetailJob

import org.quartz.SimpleTrigger; //導入方法依賴的package包/類
/**
 * Creates the open project details job
 *
 * @author Adelina
 * 
 * @throws SchedulerException
 */
private void openProjectDetailJob() throws SchedulerException {
	logger.debug("openProjectDetailJob - START-");
	
	final String myJob = "OpenProjectDetailJob";
	
	Scheduler sched = (Scheduler)CMContext.getFromContext(IConstant.SCHEDULER);
	
	JobDetail jobDetail = new JobDetail(myJob, myJob.concat("_Group"), OpenProjectDetailJob.class);
    
    // initiate SimpleTrigger with its name(myJob.concat("Trigger")) and group name(myJob.concat("_Group"))
    SimpleTrigger simpleTrigger = new SimpleTrigger(myJob.concat("Trigger"), myJob.concat("_Group"));
    // set its start up time - now
    simpleTrigger.setStartTime(new Date(System.currentTimeMillis()));
    // set the interval, how often the job should run (3600 second here - 60 minutes = 1h) - must be set 
    simpleTrigger.setRepeatInterval(3600000);  
    // set the number of execution of this job
    // it will run 1 time and exhaust.
    simpleTrigger.setRepeatCount(0);
    
    sched.scheduleJob(jobDetail, simpleTrigger);
	
	logger.debug("openProjectDetailJob - END-");
}
 
開發者ID:CodeSphere,項目名稱:termitaria,代碼行數:31,代碼來源:InitApplication.java

示例12: manageTrial

import org.quartz.SimpleTrigger; //導入方法依賴的package包/類
/**
 * Creates the trial period job
 *
 * @author alu
 * @throws SchedulerException
 */
private void manageTrial() throws SchedulerException {
	logger.debug("mannageTrial - START-");
	
	final String myJob = "TrialJob";
	
	Scheduler sched = (Scheduler)OMContext.getFromContext(IConstant.SCHEDULER);
	
	JobDetail jobDetail = new JobDetail(myJob, myJob.concat("_Group"), TrialJob.class);
    
    // initiate SimpleTrigger with its name(myJob.concat("Trigger")) and group name(myJob.concat("_Group"))
    SimpleTrigger simpleTrigger = new SimpleTrigger(myJob.concat("Trigger"), myJob.concat("_Group"));
    // set its start up time - 15 minutes from now
    simpleTrigger.setStartTime(new Date(System.currentTimeMillis()));
    // set the interval, how often the job should run (900 second here - 15 minutes) - must be set 
    simpleTrigger.setRepeatInterval(900000);
    // set the number of execution of this job
    // it will run 10000 time and exhaust.
    simpleTrigger.setRepeatCount(50000);
    
    sched.scheduleJob(jobDetail, simpleTrigger);
	
	logger.debug("manageTrial - END-");
}
 
開發者ID:CodeSphere,項目名稱:termitaria,代碼行數:30,代碼來源:InitApplication.java

示例13: getTrigger

import org.quartz.SimpleTrigger; //導入方法依賴的package包/類
@Override
public Trigger getTrigger() throws Exception
{
    if ((repeatInterval <= 0) && (repeatCount != 0))
    {
       logger.error("Job "+getBeanName()+" - repeatInterval/repeatIntervalMinutes cannot be 0 (or -ve) unless repeatCount is also 0");
       return null;
    }
    
    SimpleTrigger trigger = new SimpleTrigger(getBeanName(), Scheduler.DEFAULT_GROUP);
    trigger.setStartTime(new Date(System.currentTimeMillis() + this.startDelay));
    trigger.setRepeatCount(repeatCount);
    trigger.setRepeatInterval(repeatInterval);
    return trigger;
}
 
開發者ID:Alfresco,項目名稱:alfresco-core,代碼行數:16,代碼來源:TriggerBean.java

示例14: buildArticleContentHtml

import org.quartz.SimpleTrigger; //導入方法依賴的package包/類
public void buildArticleContentHtml(String id) {
	try {
		String jobName = BuildArticleContentHtmlJob.JOB_NAME + id;
		String triggerName = BuildArticleContentHtmlJob.TRIGGER_NAME + id;
		String groupName = BuildArticleContentHtmlJob.GROUP_NAME;
		
		SimpleTrigger simpleTrigger = new SimpleTrigger();
		simpleTrigger.setName(triggerName);
		simpleTrigger.setGroup(groupName);
		simpleTrigger.setJobName(jobName);
		simpleTrigger.setJobGroup(groupName);
		simpleTrigger.setStartTime(DateUtils.addSeconds(new Date(), SettingUtil.getSetting().getBuildHtmlDelayTime()));
		simpleTrigger.setRepeatCount(0);
		simpleTrigger.setRepeatInterval(60);
		
		JobDetail jobDetail = scheduler.getJobDetail(jobName, groupName);
		if (jobDetail != null) {
			scheduler.rescheduleJob(triggerName, groupName, simpleTrigger);
			jobDetail.getJobDataMap().put("id", id);
		} else {
			jobDetail = new JobDetail(jobName, groupName, BuildArticleContentHtmlJob.class);
			jobDetail.getJobDataMap().put("id", id);
			scheduler.scheduleJob(jobDetail, simpleTrigger);
		}
		
		if (scheduler.isShutdown()) {
			scheduler.start();
		}
	} catch (SchedulerException e) {
		e.printStackTrace();
	}
}
 
開發者ID:wangko27,項目名稱:SelfSoftShop,代碼行數:33,代碼來源:JobServiceImpl.java

示例15: buildGoodsContentHtml

import org.quartz.SimpleTrigger; //導入方法依賴的package包/類
public void buildGoodsContentHtml(String id) {
	try {
		String jobName = BuildGoodsContentHtmlJob.JOB_NAME + id;
		String triggerName = BuildGoodsContentHtmlJob.TRIGGER_NAME + id;
		String groupName = BuildGoodsContentHtmlJob.GROUP_NAME;
		
		SimpleTrigger simpleTrigger = new SimpleTrigger();
		simpleTrigger.setName(triggerName);
		simpleTrigger.setGroup(groupName);
		simpleTrigger.setJobName(jobName);
		simpleTrigger.setJobGroup(groupName);
		simpleTrigger.setStartTime(DateUtils.addSeconds(new Date(), SettingUtil.getSetting().getBuildHtmlDelayTime()));
		simpleTrigger.setRepeatCount(0);
		simpleTrigger.setRepeatInterval(60);
		
		JobDetail jobDetail = scheduler.getJobDetail(jobName, groupName);
		if (jobDetail != null) {
			scheduler.rescheduleJob(triggerName, groupName, simpleTrigger);
			jobDetail.getJobDataMap().put("id", id);
		} else {
			jobDetail = new JobDetail(jobName, groupName, BuildGoodsContentHtmlJob.class);
			jobDetail.getJobDataMap().put("id", id);
			scheduler.scheduleJob(jobDetail, simpleTrigger);
		}
		
		if (scheduler.isShutdown()) {
			scheduler.start();
		}
	} catch (SchedulerException e) {
		e.printStackTrace();
	}
}
 
開發者ID:wangko27,項目名稱:SelfSoftShop,代碼行數:33,代碼來源:JobServiceImpl.java


注:本文中的org.quartz.SimpleTrigger.setRepeatInterval方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。