java控制工具下载,quartzscheduler.java 源代码在线查看 - Java中非常实用流控制工具 资源下载 虫虫电子下 ...

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-1 00:22   104   0

* on every group. * * * * When resumeAll() is called (to un-pause), trigger misfire * instructions WILL be applied. * * * @see #resumeAll(SchedulingContext) * @see #pauseTriggerGroup(SchedulingContext, String) * @see #standby() */ public void pauseAll(SchedulingContext ctxt) throws SchedulerException { validateState(); resources.getJobStore().pauseAll(ctxt); notifySchedulerThread(0L); notifySchedulerListenersPausedTrigger(null, null); } /** * * Resume (un-pause) all triggers - equivalent of calling resumeTriggerGroup(group) * on every group. * * * * If any Trigger missed one or more fire-times, then the * Trigger's misfire instruction will be applied. * * * @see #pauseAll(SchedulingContext) */ public void resumeAll(SchedulingContext ctxt) throws SchedulerException { validateState(); resources.getJobStore().resumeAll(ctxt); notifySchedulerThread(0L); notifySchedulerListenersResumedTrigger(null, null); } /** * * Get the names of all known {@link org.quartz.Job} groups. * */ public String[] getJobGroupNames(SchedulingContext ctxt) throws SchedulerException { validateState(); return resources.getJobStore().getJobGroupNames(ctxt); } /** * * Get the names of all the {@link org.quartz.Job}s in the * given group. * */ public String[] getJobNames(SchedulingContext ctxt, String groupName) throws SchedulerException { validateState(); if(groupName == null) { groupName = Scheduler.DEFAULT_GROUP; } return resources.getJobStore().getJobNames(ctxt, groupName); } /** * * Get all {@link Trigger} s that are associated with the * identified {@link org.quartz.JobDetail}. * */ public Trigger[] getTriggersOfJob(SchedulingContext ctxt, String jobName, String groupName) throws SchedulerException { validateState(); if(groupName == null) { groupName = Scheduler.DEFAULT_GROUP; } return resources.getJobStore().getTriggersForJob(ctxt, jobName, groupName); } /** * * Get the names of all known {@link org.quartz.Trigger} * groups. * */ public String[] getTriggerGroupNames(SchedulingContext ctxt) throws SchedulerException { validateState(); return resources.getJobStore().getTriggerGroupNames(ctxt); } /** * * Get the names of all the {@link org.quartz.Trigger}s in * the given group. * */ public String[] getTriggerNames(SchedulingContext ctxt, String groupName) throws SchedulerException { validateState(); if(groupName == null) { groupName = Scheduler.DEFAULT_GROUP; } return resources.getJobStore().getTriggerNames(ctxt, groupName); } /** * * Get the {@link JobDetail} for the Job * instance with the given name and group. * */ public JobDetail getJobDetail(SchedulingContext ctxt, String jobName, String jobGroup) throws SchedulerException { validateState(); if(jobGroup == null) { jobGroup = Scheduler.DEFAULT_GROUP; } return resources.getJobStore().retrieveJob(ctxt, jobName, jobGroup); } /** * * Get the {@link Trigger} instance with the given name and * group. * */ public Trigger getTrigger(SchedulingContext ctxt, String triggerName, String triggerGroup) throws SchedulerException { validateState(); if(triggerGroup == null) { triggerGroup = Scheduler.DEFAULT_GROUP; } return resources.getJobStore().retrieveTrigger(ctxt, triggerName, triggerGroup); } /** * * Get the current state of the identified {@link Trigger}. * * * @see Trigger#STATE_NORMAL * @see Trigger#STATE_PAUSED * @see Trigger#STATE_COMPLETE * @see Trigger#STATE_ERROR */ public int getTriggerState(SchedulingContext ctxt, String triggerName, String triggerGroup) throws SchedulerException { validateState(); if(triggerGroup == null) { triggerGroup = Scheduler.DEFAULT_GROUP; } return resources.getJobStore().getTriggerState(ctxt, triggerName, triggerGroup); } /** * * Add (register) the given Calendar to the Scheduler. * * * @throws SchedulerException * if there is an internal Scheduler error, or a Calendar with * the same name already exists, and replace is * false. */ public void addCalendar(SchedulingContext ctxt, String calName, Calendar calendar, boolean replace, boolean updateTriggers) throws SchedulerException { validateState(); resources.getJobStore().storeCalendar(ctxt, calName, calendar, replace, updateTriggers); } /** * * Delete the identified Calendar from the Scheduler. * * * @return true if the Calendar was found and deleted. * @throws SchedulerException * if there is an internal Scheduler error. */ public boolean deleteCalendar(SchedulingContext ctxt, String calName) throws SchedulerException { validateState(); return resources.getJobStore().removeCalendar(ctxt, calName); } /** * * Get the {@link Calendar} instance with the given name. * */ public Calendar getCalendar(SchedulingContext ctxt, String calName) throws SchedulerException { validateState(); return resources.getJobStore().retrieveCalendar(ctxt, calName); } /** * * Get the names of all registered {@link Calendar}s. * */ public String[] getCalendarNames(SchedulingContext ctxt) throws SchedulerException { validateState(); return resources.getJobStore().getCalendarNames(ctxt); } /** * * Add the given {@link org.quartz.JobListener} to the * Scheduler'sglobal list. * * * * Listeners in the 'global' list receive notification of execution events * for ALL {@link org.quartz.Job}s. * */ public void addGlobalJobListener(JobListener jobListener) { if (jobListener.getName() == null || jobListener.getName().length() == 0) { throw new IllegalArgumentException( "JobListener name cannot be empty."); } synchronized (globalJobListeners) { globalJobListeners.put(jobListener.getName(), jobListener); } } /** * * Add the given {@link org.quartz.JobListener} to the * Scheduler's list, of registered JobListeners. */ public void addJobListener(JobListener jobListener) { if (jobListener.getName() == null || jobListener.getName().length() == 0) { throw new IllegalArgumentException( "JobListener name cannot be empty."); } synchronized (jobListeners) { jobListeners.put(jobListener.getName(), jobListener); } } /** * * Remove the given {@link org.quartz.JobListener} from the * Scheduler's list of global listeners. * * * @return true if the identifed listener was found in the list, and * removed. * * @deprecated Use {@link #removeGlobalJobListener(String)} */ public boolean removeGlobalJobListener(JobListener jobListener) { return removeGlobalJobListener((jobListener == null) ? null : jobListener.getName()); } /** * * Remove the identifed {@link JobListener} from the Scheduler's * list of global listeners. * * * @return true if the identifed listener was found in the list, and * removed. */ public boolean removeGlobalJobListener(String name) { synchronized (globalJobListeners) { return (globalJobListeners.remove(name) != null); } } /** * * Remove the identifed {@link org.quartz.JobListener} from * the Scheduler's list of registered listeners. * * * @return true if the identifed listener was found in the list, and * removed. */ public boolean removeJobListener(String name) { synchronized (jobListeners) { return (jobListeners.remove(name) != null); } } /** * * Get a List containing all of the {@link org.quartz.JobListener} * s in the Scheduler'sglobal list. * */ public List getGlobalJobListeners() { synchronized (globalJobListeners) { return new LinkedList(globalJobListeners.values()); } } /** * * Get a Set containing the names of all the non-global{@link org.quartz.JobListener} * s registered with the Scheduler. * */ public Set getJobListenerNames() { synchronized (jobListeners) { return new HashSet(jobListeners.keySet()); } } /** * * Get the global{@link org.quartz.JobListener} * that has the given name. * */ public JobListener getGlobalJobListener(String name) { synchronized (globalJobListeners) { return (JobListener)globalJobListeners.get(name); } } /** * * Get the non-global{@link org.quartz.JobListener} * that has the given name. * */ public JobListener getJobListener(String name) { synchronized (jobListeners) { return (JobListener) jobListeners.get(name); } } /** * * Add the given {@link org.quartz.TriggerListener} to the * Scheduler'sglobal list. * * * * Listeners in the 'global' list receive notification of execution events * for ALL {@link org.quartz.Trigger}s. * */ public void addGlobalTriggerListener(TriggerListener triggerListener) { if (triggerListener.getName() == null || triggerListener.getName().length() == 0) { throw new IllegalArgumentException( "TriggerListener name cannot be empty."); } synchronized (globalTriggerListeners) { globalTriggerListeners.put(triggerListener.getName(), triggerListener); } } /** * * Add the given {@link org.quartz.TriggerListener} to the * Scheduler's list, of registered TriggerListeners. */ public void addTriggerListener(TriggerListener triggerListener) { if (triggerListener.getName() == null

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP