org.quartz.JobDetail

Here are the examples of the java api org.quartz.JobDetail taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

369 Examples 7

19 Source : Task.java
with Apache License 2.0
from WeBankBlockchain

public void setJobDetail(JobDetail jobDetail) {
    this.jobDetail = jobDetail;
}

19 Source : SimpleTriggerFactoryBean.java
with MIT License
from Vip-Augus

/**
 * Set the JobDetail that this trigger should be replacedociated with.
 */
public void setJobDetail(JobDetail jobDetail) {
    this.jobDetail = jobDetail;
}

19 Source : SchedulerAccessor.java
with MIT License
from Vip-Augus

/**
 * Register a list of JobDetail objects with the Scheduler that
 * this FactoryBean creates, to be referenced by Triggers.
 * <p>This is not necessary when a Trigger determines the JobDetail
 * itself: In this case, the JobDetail will be implicitly registered
 * in combination with the Trigger.
 * @see #setTriggers
 * @see org.quartz.JobDetail
 */
public void setJobDetails(JobDetail... jobDetails) {
    // Use modifiable ArrayList here, to allow for further adding of
    // JobDetail objects during autodetection of JobDetail-aware Triggers.
    this.jobDetails = new ArrayList<>(Arrays.asList(jobDetails));
}

19 Source : SchedulerAccessor.java
with MIT License
from Vip-Augus

/**
 * Add the given job to the Scheduler, if it doesn't already exist.
 * Overwrites the job in any case if "overwriteExistingJobs" is set.
 * @param jobDetail the job to add
 * @return {@code true} if the job was actually added,
 * {@code false} if it already existed before
 * @see #setOverwriteExistingJobs
 */
private boolean addJobToScheduler(JobDetail jobDetail) throws SchedulerException {
    if (this.overwriteExistingJobs || getScheduler().getJobDetail(jobDetail.getKey()) == null) {
        getScheduler().addJob(jobDetail, true);
        return true;
    } else {
        return false;
    }
}

19 Source : MethodInvokingJobDetailFactoryBean.java
with MIT License
from Vip-Augus

/**
 * Callback for post-processing the JobDetail to be exposed by this FactoryBean.
 * <p>The default implementation is empty. Can be overridden in subclreplacedes.
 * @param jobDetail the JobDetail prepared by this FactoryBean
 */
protected void postProcessJobDetail(JobDetail jobDetail) {
}

19 Source : TaskTrigger.java
with Apache License 2.0
from SwingFrog

public void setJob(JobDetail job) {
    this.job = job;
}

19 Source : QuartzManager.java
with Apache License 2.0
from quartzweb

/**
 * 添加job
 * @param schedulerName
 * @param jobDetail
 * @return
 * @throws SchedulerException
 */
public void addJob(String schedulerName, JobDetail jobDetail) throws SchedulerException {
    this.addJob(schedulerName, jobDetail, false);
}

19 Source : SchedulerAccessor.java
with Apache License 2.0
from langtianya

/**
 * Register a list of JobDetail objects with the Scheduler that
 * this FactoryBean creates, to be referenced by Triggers.
 * <p>This is not necessary when a Trigger determines the JobDetail
 * itself: In this case, the JobDetail will be implicitly registered
 * in combination with the Trigger.
 * @see #setTriggers
 * @see org.quartz.JobDetail
 */
public void setJobDetails(JobDetail... jobDetails) {
    // Use modifiable ArrayList here, to allow for further adding of
    // JobDetail objects during autodetection of JobDetail-aware Triggers.
    this.jobDetails = new ArrayList<JobDetail>(Arrays.asList(jobDetails));
}

19 Source : SchedulerListenerSupport.java
with Apache License 2.0
from AsuraTeam

public void jobAdded(JobDetail jobDetail) {
}

19 Source : RemoteScheduler.java
with Apache License 2.0
from AsuraTeam

/**
 * <p>
 * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
 * preplaceding the <code>SchedulingContext</code> replacedociated with this
 * instance.
 * </p>
 */
public void addJob(JobDetail jobDetail, boolean replace) throws SchedulerException {
    try {
        getRemoteScheduler().addJob(schedCtxt, jobDetail, replace);
    } catch (RemoteException re) {
        throw invalidateHandleCreateException("Error communicating with remote scheduler.", re);
    }
}

19 Source : RemoteMBeanScheduler.java
with Apache License 2.0
from AsuraTeam

/**
 * <p>
 * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
 * preplaceding the <code>SchedulingContext</code> replacedociated with this
 * instance.
 * </p>
 */
public void addJob(JobDetail jobDetail, boolean replace) throws SchedulerException {
    invoke("addJob", new Object[] { schedulingContext, jobDetail, toBoolean(replace) }, new String[] { SchedulingContext.clreplaced.getName(), JobDetail.clreplaced.getName(), boolean.clreplaced.getName() });
}

19 Source : SampledStatisticsImpl.java
with Apache License 2.0
from AsuraTeam

public void jobAdded(JobDetail jobDetail) {
/**/
}

19 Source : QuartzSchedulerMBeanImpl.java
with Apache License 2.0
from AsuraTeam

// ScheduleListener
public void jobAdded(JobDetail jobDetail) {
    sendNotification(JOB_ADDED, JobDetailSupport.toCompositeData(jobDetail));
}

19 Source : JobDetailSupport.java
with Apache License 2.0
from AsuraTeam

/**
 * @param jobDetail
 * @return CompositeData
 */
public static CompositeData toCompositeData(JobDetail jobDetail) {
    try {
        return new CompositeDataSupport(COMPOSITE_TYPE, ITEM_NAMES, new Object[] { jobDetail.getName(), jobDetail.getGroup(), jobDetail.getDescription(), jobDetail.getJobClreplaced().getName(), JobDataMapSupport.toTabularData(jobDetail.getJobDataMap()), jobDetail.isVolatile(), jobDetail.isDurable(), jobDetail.requestsRecovery() });
    } catch (OpenDataException e) {
        throw new RuntimeException(e);
    }
}

19 Source : QuartzUtils.java
with Apache License 2.0
from andrehertwig

/**
 * <br><br>
 * <code>
 * {@literal @}Bean<br>
 * public SimpleTriggerFactoryBean createSimpleTrigger({@literal @}Qualifier("simpleJobDetail") JobDetail jobDetail) {<br>
 *     return QuartzJobUtils.createSimpleTrigger(jobDetail, null, null, "Simple trigger 1", 5000L, 60000L, SimpleTrigger.REPEAT_INDEFINITELY,
 *     SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT, null, 1 );<br>
 * }<br>
 * </code>
 *
 * @param jobDetail
 * @param triggerName (optional)
 * @param triggerGroup (optional)
 * @param triggerDescription (optional)
 * @param startDelay
 * @param repeatInterval for infinity: {@link SimpleTrigger#REPEAT_INDEFINITELY}
 * @param repeatCount
 * @param misfireInstruction {@link SimpleTrigger}
 * @param jobData (optional)
 * @param priority
 * @return
 */
public static SimpleTriggerFactoryBean createSimpleTrigger(JobDetail jobDetail, String triggerName, String triggerGroup, String triggerDescription, long startDelay, long repeatInterval, int repeatCount, int misfireInstruction, Map<String, ?> jobData, int priority) {
    return QuartzUtils.simpleTriggerBuilder().jobDetail(jobDetail).name(triggerName).group(triggerGroup).description(triggerDescription).startDelay(startDelay).repeatInterval(repeatInterval).repeatCount(repeatCount).misfireInstruction(misfireInstruction).putJobData(jobData).priority(priority).getTriggerFactoryBean();
}

18 Source : QuartzManager.java
with Apache License 2.0
from WeBankFinTech

/**
 * get the job message
 *
 * @param jobName
 * @return
 */
public CEPRule getJobDetail(String jobName) throws SchedulerException, BrokerException {
    JobDetail job = scheduler.getJobDetail(new JobKey(jobName, "rule"));
    if (!StringUtils.isEmpty(job.getJobDataMap().get("rule"))) {
        return JsonHelper.json2Object(job.getJobDataMap().get("rule").toString(), CEPRule.clreplaced);
    }
    return null;
}

18 Source : Task.java
with Apache License 2.0
from WeBankBlockchain

public clreplaced Task {

    Trigger trigger;

    JobDetail jobDetail;

    public Task(Trigger trigger, JobDetail jobDetail) {
        this.trigger = trigger;
        this.jobDetail = jobDetail;
    }

    public Trigger getTrigger() {
        return trigger;
    }

    public void setTrigger(Trigger trigger) {
        this.trigger = trigger;
    }

    public JobDetail getJobDetail() {
        return jobDetail;
    }

    public void setJobDetail(JobDetail jobDetail) {
        this.jobDetail = jobDetail;
    }
}

18 Source : SchedulerConfig.java
with Apache License 2.0
from ucarGroup

/**
 * 历史数据清除定时任务触发器信息
 *
 * @param jobDetail      job信息
 * @param cronExpression cron表达式
 * @return
 */
@Bean(name = "cleanCollectDataJobTrigger")
public CronTriggerFactoryBean cleanCollectDataJobTrigger(@Qualifier("cleanCollectDataJobDetail") JobDetail jobDetail, @Value(SchedulerConstant.ZK_CLEAN_JOB_CRON) String cronExpression) {
    return createCronTrigger(jobDetail, cronExpression, SchedulerConstant.ZK_CLEAN_TRIGGER_NAME, SchedulerConstant.ZK_CLEAN_TRIGGER_GROUP);
}

18 Source : PacmanQuartzConfiguration.java
with Apache License 2.0
from tmobile

@Bean(name = "weeklyReportSyncJobTrigger")
public CronTriggerFactoryBean weeklyReportSyncJobTrigger(@Qualifier("weeklyScheduleJobDetail") JobDetail jobDetail, @Value("${cron.frequency.weekly-report-sync-trigger}") String frequency) {
    return createCronTrigger(jobDetail, frequency);
}

18 Source : TaskTrigger.java
with Apache License 2.0
from SwingFrog

public clreplaced TaskTrigger {

    private JobDetail job;

    private Trigger trigger;

    public TaskTrigger(JobDetail job, Trigger trigger) {
        this.job = job;
        this.trigger = trigger;
    }

    public JobDetail getJob() {
        return job;
    }

    public void setJob(JobDetail job) {
        this.job = job;
    }

    public Trigger getTrigger() {
        return trigger;
    }

    public void setTrigger(Trigger trigger) {
        this.trigger = trigger;
    }
}

18 Source : ScheduledGitPollScheduler.java
with Mozilla Public License 2.0
from secdec

protected void setAdditionalJobDataMap(JobDetail job, ScheduledGitPoll scheduledGitPoll) {
    job.getJobDataMap().put("applicationId", scheduledGitPoll.getApplication().getId());
    // Since the super replacedumes the same queue we will replace it
    job.getJobDataMap().put("queueSender", gitQueueSender);
}

18 Source : JobManager.java
with MIT License
from ria-ee

/**
 * Registers a repeating job with the specified repeat interval.
 * @param jobClreplaced clreplaced of the job that needs to be repeated
 * @param intervalInSeconds repeat interval of the job
 * @throws SchedulerException if the Job or Trigger cannot be added to the Scheduler,
 * or there is an internal Scheduler error
 */
public void registerRepeatingJob(Clreplaced<? extends Job> jobClreplaced, int intervalInSeconds) throws SchedulerException {
    JobDetail job = newJob(jobClreplaced).withIdenreplacedy(jobClreplaced.getSimpleName(), DEFAULT_JOB_GROUP).build();
    Trigger trigger = newTrigger().withIdenreplacedy(jobClreplaced.getSimpleName(), DEFAULT_JOB_GROUP).withSchedule(simpleSchedule().withIntervalInSeconds(intervalInSeconds).repeatForever()).startNow().build();
    jobScheduler.scheduleJob(job, trigger);
}

18 Source : SchedulerConfiguration.java
with Apache License 2.0
from reportportal

@Bean
@Profile("!demo")
public SimpleTriggerFactoryBean cleanScreenshotsTrigger(@Named("cleanScreenshotsJobBean") JobDetail jobDetail, @Value("${com.ta.reportportal.job.clean.screenshots.cron}") String cleanScreenshotsCron) {
    return createTriggerDelayed(jobDetail, Duration.parse(cleanScreenshotsCron).toMillis());
}

18 Source : SchedulerConfiguration.java
with Apache License 2.0
from reportportal

// Use this method for creating cron triggers instead of simple triggers:
public static CronTriggerFactoryBean createCronTrigger(JobDetail jobDetail, String cronExpression) {
    CronTriggerFactoryBean factoryBean = new CronTriggerFactoryBean();
    factoryBean.setJobDetail(jobDetail);
    factoryBean.setCronExpression(cronExpression);
    factoryBean.setMisfireInstruction(SimpleTrigger.MISFIRE_INSTRUCTION_FIRE_NOW);
    return factoryBean;
}

18 Source : SchedulerConfiguration.java
with Apache License 2.0
from reportportal

@Bean
public SimpleTriggerFactoryBean interruptLaunchesTrigger(@Named("interruptLaunchesJobBean") JobDetail jobDetail, @Value("${com.ta.reportportal.job.interrupt.broken.launches.cron}") String interruptLaunchesCron) {
    return createTriggerDelayed(jobDetail, Duration.parse(interruptLaunchesCron).toMillis());
}

18 Source : SchedulerConfiguration.java
with Apache License 2.0
from reportportal

@Bean
@Profile("demo")
public SimpleTriggerFactoryBean flushingDataTrigger(@Named("flushingDataJob") JobDetail jobDetail, @Value("${com.ta.reportportal.rp.flushing.time.cron}") String flushingCron) {
    return createTrigger(jobDetail, Duration.parse(flushingCron).toMillis());
}

18 Source : SchedulerConfiguration.java
with Apache License 2.0
from reportportal

@Bean
@Profile("!demo")
public SimpleTriggerFactoryBean createCleanLaunchesTrigger(@Named("cleanLaunchesJobBean") JobDetail jobDetail, @Value("${com.ta.reportportal.job.clean.launches.cron}") String cleanLaunchesCron) {
    return createTriggerDelayed(jobDetail, Duration.parse(cleanLaunchesCron).toMillis());
}

18 Source : SchedulerConfiguration.java
with Apache License 2.0
from reportportal

@Bean
@Profile("!demo")
public SimpleTriggerFactoryBean createCleanLogsTrigger(@Named("cleanLogsJobBean") JobDetail jobDetail, @Value("${com.ta.reportportal.job.clean.logs.cron}") String cleanLogsCron) {
    return createTriggerDelayed(jobDetail, Duration.parse(cleanLogsCron).toMillis());
}

18 Source : SchedulerConfiguration.java
with Apache License 2.0
from reportportal

@Bean
public SimpleTriggerFactoryBean cleanExpiredCreationBidsTrigger(@Named("cleanExpiredCreationBidsJobBean") JobDetail jobDetail, @Value("${com.ta.reportportal.job.clean.bids.cron}") String cleanBidsCron) {
    return createTrigger(jobDetail, Duration.parse(cleanBidsCron).toMillis());
}

18 Source : QuartzUtils.java
with Apache License 2.0
from quartzweb

/**
 * 获取Job分组
 * @param jobDetail
 * @return
 */
public static String getJobGroup(JobDetail jobDetail) {
    return jobDetail.getKey().getGroup();
}

18 Source : QuartzUtils.java
with Apache License 2.0
from quartzweb

/**
 * 获取Job名称
 * @param jobDetail
 * @return
 */
public static String getJobName(JobDetail jobDetail) {
    return jobDetail.getKey().getName();
}

18 Source : QuartzWebManager.java
with Apache License 2.0
from quartzweb

public static JobDetail updateJob(String schedulerName, JobDetail jobDetail) throws SchedulerException {
    quartzManager.updateJob(schedulerName, jobDetail);
    return jobDetail;
}

18 Source : QuartzWebManager.java
with Apache License 2.0
from quartzweb

public static JobDetail addJob(String schedulerName, JobDetail jobDetail) throws SchedulerException {
    quartzManager.addJob(schedulerName, jobDetail);
    return jobDetail;
}

18 Source : QuartzManager.java
with Apache License 2.0
from quartzweb

public void updateJob(String schedulerName, JobDetail jobDetail) throws SchedulerException {
    if (existJob(schedulerName, jobDetail.getKey().getName(), jobDetail.getKey().getGroup())) {
        // 替换
        this.addJob(schedulerName, jobDetail, true);
    } else {
        throw new IllegalArgumentException("job [" + jobDetail.getKey().getName() + ":" + jobDetail.getKey().getGroup() + "] not exist");
    }
}

18 Source : QuartzManager.java
with Apache License 2.0
from quartzweb

public void addTriggerForJob(String schedulerName, String jobName, String jobGroup, Trigger trigger) throws SchedulerException {
    JobDetail jobDetail = this.getJob(schedulerName, jobName, jobGroup);
    addTriggerForJob(schedulerName, jobDetail, trigger);
}

18 Source : OsgpScheduler.java
with Apache License 2.0
from OSGP

public void deleteScheduledJob(final Clreplaced<? extends Job> jobClreplaced) throws SchedulerException {
    final JobDetail jobDetail = this.createJobDetail(jobClreplaced);
    this.quartzScheduler.deleteJob(jobDetail.getKey());
}

18 Source : OsgpScheduler.java
with Apache License 2.0
from OSGP

/**
 * Create a {@link Trigger} instance using a {@link JobDetail} instance and
 * a CRON-expression, the default TimeZone will be used
 *
 * @param jobDetail
 *            A {@link JobDetail} instance, possibly created using
 *            {@link OsgpScheduler#createJobDetail(Clreplaced)}.
 * @param cronExpression
 *            A CRON-expression.
 *
 * @return A {@link Trigger} instance.
 */
public Trigger createJobTrigger(final JobDetail jobDetail, final String cronExpression) {
    return this.createJobTrigger(jobDetail, cronExpression, DateTimeZone.UTC.toTimeZone());
}

18 Source : QuartzUtils.java
with Apache License 2.0
from OpenWiseSolutions

/**
 * Create {@link Trigger} name from {@link JobDetail}.
 *
 * @param jobDetail    job detail
 * @param triggerOrder trigger order for same job
 * @return trigger name
 * @see #TRIGGER_NAME_SUFFIX
 */
public static String createTriggerName(JobDetail jobDetail, int triggerOrder) {
    replacedert.notNull(jobDetail, "jobDetail must not be null");
    return jobDetail.getKey().getGroup() + "_" + jobDetail.getKey().getName() + (triggerOrder > 1 ? "_" + triggerOrder : "") + TRIGGER_NAME_SUFFIX;
}

18 Source : CronService.java
with GNU General Public License v3.0
from MobiusDevelopment

public List<? extends Trigger> getJobTriggers(JobDetail jd) {
    return getJobTriggers(jd.getKey());
}

18 Source : MethodInvokingJobDetailFactoryBean.java
with Apache License 2.0
from langtianya

/**
 * {@link org.springframework.beans.factory.FactoryBean} that exposes a
 * {@link org.quartz.JobDetail} object which delegates job execution to a
 * specified (static or non-static) method. Avoids the need for implementing
 * a one-line Quartz Job that just invokes an existing service method on a
 * Spring-managed target bean.
 *
 * <p>Inherits common configuration properties from the {@link MethodInvoker}
 * base clreplaced, such as {@link #setTargetObject "targetObject"} and
 * {@link #setTargetMethod "targetMethod"}, adding support for lookup of the target
 * bean by name through the {@link #setTargetBeanName "targetBeanName"} property
 * (as alternative to specifying a "targetObject" directly, allowing for
 * non-singleton target objects).
 *
 * <p>Supports both concurrently running jobs and non-currently running
 * jobs through the "concurrent" property. Jobs created by this
 * MethodInvokingJobDetailFactoryBean are by default volatile and durable
 * (according to Quartz terminology).
 *
 * <p><b>NOTE: JobDetails created via this FactoryBean are <i>not</i>
 * serializable and thus not suitable for persistent job stores.</b>
 * You need to implement your own Quartz Job as a thin wrapper for each case
 * where you want a persistent job to delegate to a specific service method.
 *
 * <p>Compatible with Quartz 2.1.4 and higher, as of Spring 4.1.
 *
 * @author Juergen Hoeller
 * @author Alef Arendsen
 * @since 18.02.2004
 * @see #setTargetBeanName
 * @see #setTargetObject
 * @see #setTargetMethod
 * @see #setConcurrent
 */
public clreplaced MethodInvokingJobDetailFactoryBean extends ArgumentConvertingMethodInvoker implements FactoryBean<JobDetail>, BeanNameAware, BeanClreplacedLoaderAware, BeanFactoryAware, InitializingBean {

    private String name;

    private String group = Scheduler.DEFAULT_GROUP;

    private boolean concurrent = true;

    private String targetBeanName;

    private String beanName;

    private ClreplacedLoader beanClreplacedLoader = ClreplacedUtils.getDefaultClreplacedLoader();

    private BeanFactory beanFactory;

    private JobDetail jobDetail;

    /**
     * Set the name of the job.
     * <p>Default is the bean name of this FactoryBean.
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * Set the group of the job.
     * <p>Default is the default group of the Scheduler.
     * @see org.quartz.Scheduler#DEFAULT_GROUP
     */
    public void setGroup(String group) {
        this.group = group;
    }

    /**
     * Specify whether or not multiple jobs should be run in a concurrent fashion.
     * The behavior when one does not want concurrent jobs to be executed is
     * realized through adding the {@code @PersistJobDataAfterExecution} and
     * {@code @DisallowConcurrentExecution} markers.
     * More information on stateful versus stateless jobs can be found
     * <a href="http://www.quartz-scheduler.org/doreplacedentation/quartz-2.1.x/tutorials/tutorial-lesson-03">here</a>.
     * <p>The default setting is to run jobs concurrently.
     */
    public void setConcurrent(boolean concurrent) {
        this.concurrent = concurrent;
    }

    /**
     * Set the name of the target bean in the Spring BeanFactory.
     * <p>This is an alternative to specifying {@link #setTargetObject "targetObject"},
     * allowing for non-singleton beans to be invoked. Note that specified
     * "targetObject" and {@link #setTargetClreplaced "targetClreplaced"} values will
     * override the corresponding effect of this "targetBeanName" setting
     * (i.e. statically pre-define the bean type or even the bean object).
     */
    public void setTargetBeanName(String targetBeanName) {
        this.targetBeanName = targetBeanName;
    }

    @Override
    public void setBeanName(String beanName) {
        this.beanName = beanName;
    }

    @Override
    public void setBeanClreplacedLoader(ClreplacedLoader clreplacedLoader) {
        this.beanClreplacedLoader = clreplacedLoader;
    }

    @Override
    public void setBeanFactory(BeanFactory beanFactory) {
        this.beanFactory = beanFactory;
    }

    @Override
    protected Clreplaced<?> resolveClreplacedName(String clreplacedName) throws ClreplacedNotFoundException {
        return ClreplacedUtils.forName(clreplacedName, this.beanClreplacedLoader);
    }

    @Override
    @SuppressWarnings("unchecked")
    public void afterPropertiesSet() throws ClreplacedNotFoundException, NoSuchMethodException {
        prepare();
        // Use specific name if given, else fall back to bean name.
        String name = (this.name != null ? this.name : this.beanName);
        // Consider the concurrent flag to choose between stateful and stateless job.
        Clreplaced<?> jobClreplaced = (this.concurrent ? MethodInvokingJob.clreplaced : StatefulMethodInvokingJob.clreplaced);
        // Build JobDetail instance.
        JobDetailImpl jdi = new JobDetailImpl();
        jdi.setName(name);
        jdi.setGroup(this.group);
        jdi.setJobClreplaced((Clreplaced) jobClreplaced);
        jdi.setDurability(true);
        jdi.getJobDataMap().put("methodInvoker", this);
        this.jobDetail = jdi;
        postProcessJobDetail(this.jobDetail);
    }

    /**
     * Callback for post-processing the JobDetail to be exposed by this FactoryBean.
     * <p>The default implementation is empty. Can be overridden in subclreplacedes.
     * @param jobDetail the JobDetail prepared by this FactoryBean
     */
    protected void postProcessJobDetail(JobDetail jobDetail) {
    }

    /**
     * Overridden to support the {@link #setTargetBeanName "targetBeanName"} feature.
     */
    @Override
    public Clreplaced<?> getTargetClreplaced() {
        Clreplaced<?> targetClreplaced = super.getTargetClreplaced();
        if (targetClreplaced == null && this.targetBeanName != null) {
            replacedert.state(this.beanFactory != null, "BeanFactory must be set when using 'targetBeanName'");
            targetClreplaced = this.beanFactory.getType(this.targetBeanName);
        }
        return targetClreplaced;
    }

    /**
     * Overridden to support the {@link #setTargetBeanName "targetBeanName"} feature.
     */
    @Override
    public Object getTargetObject() {
        Object targetObject = super.getTargetObject();
        if (targetObject == null && this.targetBeanName != null) {
            replacedert.state(this.beanFactory != null, "BeanFactory must be set when using 'targetBeanName'");
            targetObject = this.beanFactory.getBean(this.targetBeanName);
        }
        return targetObject;
    }

    @Override
    public JobDetail getObject() {
        return this.jobDetail;
    }

    @Override
    public Clreplaced<? extends JobDetail> getObjectType() {
        return (this.jobDetail != null ? this.jobDetail.getClreplaced() : JobDetail.clreplaced);
    }

    @Override
    public boolean isSingleton() {
        return true;
    }

    /**
     * Quartz Job implementation that invokes a specified method.
     * Automatically applied by MethodInvokingJobDetailFactoryBean.
     */
    public static clreplaced MethodInvokingJob extends QuartzJobBean {

        protected static final Log logger = LogFactory.getLog(MethodInvokingJob.clreplaced);

        private MethodInvoker methodInvoker;

        /**
         * Set the MethodInvoker to use.
         */
        public void setMethodInvoker(MethodInvoker methodInvoker) {
            this.methodInvoker = methodInvoker;
        }

        /**
         * Invoke the method via the MethodInvoker.
         */
        @Override
        protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
            try {
                context.setResult(this.methodInvoker.invoke());
            } catch (InvocationTargetException ex) {
                if (ex.getTargetException() instanceof JobExecutionException) {
                    // -> JobExecutionException, to be logged at info level by Quartz
                    throw (JobExecutionException) ex.getTargetException();
                } else {
                    // -> "unhandled exception", to be logged at error level by Quartz
                    throw new JobMethodInvocationFailedException(this.methodInvoker, ex.getTargetException());
                }
            } catch (Exception ex) {
                // -> "unhandled exception", to be logged at error level by Quartz
                throw new JobMethodInvocationFailedException(this.methodInvoker, ex);
            }
        }
    }

    /**
     * Extension of the MethodInvokingJob, implementing the StatefulJob interface.
     * Quartz checks whether or not jobs are stateful and if so,
     * won't let jobs interfere with each other.
     */
    @PersistJobDataAfterExecution
    @DisallowConcurrentExecution
    public static clreplaced StatefulMethodInvokingJob extends MethodInvokingJob {
        // No implementation, just an addition of the tag interface StatefulJob
        // in order to allow stateful method invoking jobs.
    }
}

18 Source : TimerService.java
with Apache License 2.0
from ConsenSys

public clreplaced TimerService extends Service {

    public static final String TIME_EVENTS_CHANNEL = "TimeEventsChannel";

    private final Scheduler sched;

    private final JobDetail job;

    private static int START_DELAY = 0;

    private int interval;

    public TimerService(ServiceConfig config) {
        SchedulerFactory sf = new StdSchedulerFactory();
        // Tick interval
        this.interval = (int) ((1.0 / TIME_TICKER_REFRESH_RATE) * 1000);
        try {
            sched = sf.getScheduler();
            job = newJob(ScheduledTimeEvent.clreplaced).withIdenreplacedy("Timer").build();
            job.getJobDataMap().put(TIME_EVENTS_CHANNEL, config.getEventChannels().getPublisher(TimeTickChannel.clreplaced));
        } catch (SchedulerException e) {
            throw new IllegalArgumentException("TimerService failed to initialize", e);
        }
    }

    @Override
    public SafeFuture<?> doStart() {
        try {
            SimpleTrigger trigger = newTrigger().withIdenreplacedy("TimerTrigger").startAt(DateBuilder.futureDate(START_DELAY, DateBuilder.IntervalUnit.MILLISECOND)).withSchedule(simpleSchedule().withIntervalInMilliseconds(interval).repeatForever()).build();
            sched.scheduleJob(job, trigger);
            sched.start();
            return SafeFuture.COMPLETE;
        } catch (SchedulerException e) {
            return SafeFuture.failedFuture(new RuntimeException("TimerService failed to start", e));
        }
    }

    @Override
    public SafeFuture<?> doStop() {
        try {
            sched.shutdown();
            return SafeFuture.COMPLETE;
        } catch (SchedulerException e) {
            return SafeFuture.failedFuture(new RuntimeException("TimerService failed to stop", e));
        }
    }
}

18 Source : XMLSchedulingDataProcessor.java
with Apache License 2.0
from AsuraTeam

protected void addJobToSchedule(JobDetail job) {
    loadedJobs.add(job);
}

18 Source : StdScheduler.java
with Apache License 2.0
from AsuraTeam

/**
 * <p>
 * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
 * preplaceding the <code>SchedulingContext</code> replacedociated with this
 * instance.
 * </p>
 */
public void addJob(JobDetail jobDetail, boolean replace) throws SchedulerException {
    sched.addJob(schedCtxt, jobDetail, replace);
}

18 Source : StdScheduler.java
with Apache License 2.0
from AsuraTeam

// /////////////////////////////////////////////////////////////////////////
// /
// / Scheduling-related Methods
// /
// /////////////////////////////////////////////////////////////////////////
/**
 * <p>
 * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
 * preplaceding the <code>SchedulingContext</code> replacedociated with this
 * instance.
 * </p>
 */
public Date scheduleJob(JobDetail jobDetail, Trigger trigger) throws SchedulerException {
    return sched.scheduleJob(schedCtxt, jobDetail, trigger);
}

18 Source : RemoteScheduler.java
with Apache License 2.0
from AsuraTeam

// /////////////////////////////////////////////////////////////////////////
// /
// / Scheduling-related Methods
// /
// /////////////////////////////////////////////////////////////////////////
/**
 * <p>
 * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
 * preplaceding the <code>SchedulingContext</code> replacedociated with this
 * instance.
 * </p>
 */
public Date scheduleJob(JobDetail jobDetail, Trigger trigger) throws SchedulerException {
    try {
        return getRemoteScheduler().scheduleJob(schedCtxt, jobDetail, trigger);
    } catch (RemoteException re) {
        throw invalidateHandleCreateException("Error communicating with remote scheduler.", re);
    }
}

18 Source : RemoteMBeanScheduler.java
with Apache License 2.0
from AsuraTeam

// /////////////////////////////////////////////////////////////////////////
// /
// / Scheduling-related Methods
// /
// /////////////////////////////////////////////////////////////////////////
/**
 * <p>
 * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
 * preplaceding the <code>SchedulingContext</code> replacedociated with this
 * instance.
 * </p>
 */
public Date scheduleJob(JobDetail jobDetail, Trigger trigger) throws SchedulerException {
    return (Date) invoke("scheduleJob", new Object[] { schedulingContext, jobDetail, trigger }, new String[] { SchedulingContext.clreplaced.getName(), JobDetail.clreplaced.getName(), Trigger.clreplaced.getName() });
}

18 Source : QuartzSchedulerMBeanImpl.java
with Apache License 2.0
from AsuraTeam

public Date scheduleJob(String instanceId, String jobName, String jobGroup, String triggerName, String triggerGroup) throws SchedulerException {
    SchedulingContext cntx = new SchedulingContext(instanceId);
    JobDetail jobDetail = scheduler.getJobDetail(cntx, jobName, jobGroup);
    if (jobDetail == null) {
        throw new SchedulerException("No such job: " + jobName + "." + jobGroup);
    }
    Trigger trigger = scheduler.getTrigger(cntx, triggerName, triggerGroup);
    if (trigger == null) {
        throw new SchedulerException("No such trigger: " + triggerName + "." + triggerGroup);
    }
    return scheduler.scheduleJob(cntx, jobDetail, trigger);
}

18 Source : JobRunShell.java
with Apache License 2.0
from AsuraTeam

public boolean completeTriggerRetryLoop(Trigger trigger, JobDetail jobDetail, int instCode) {
    long count = 0;
    while (!shutdownRequested) {
        try {
            // retry per config setting (the db connection must be failed)
            Thread.sleep(qs.getDbRetryInterval());
            qs.notifyJobStoreJobComplete(schdCtxt, trigger, jobDetail, instCode);
            return true;
        } catch (JobPersistenceException jpe) {
            if (count % 4 == 0)
                qs.notifySchedulerListenersError("An error occured while marking executed job complete (will continue attempts). job= '" + jobDetail.getFullName() + "'", jpe);
        } catch (InterruptedException ignore) {
        }
        count++;
    }
    return false;
}

18 Source : JobRunShell.java
with Apache License 2.0
from AsuraTeam

public boolean vetoedJobRetryLoop(Trigger trigger, JobDetail jobDetail, int instCode) {
    while (!shutdownRequested) {
        try {
            // retry per config setting (the db connection must be failed)
            Thread.sleep(qs.getDbRetryInterval());
            qs.notifyJobStoreJobVetoed(schdCtxt, trigger, jobDetail, instCode);
            return true;
        } catch (JobPersistenceException jpe) {
            qs.notifySchedulerListenersError("An error occured while marking executed job vetoed. job= '" + jobDetail.getFullName() + "'", jpe);
        } catch (InterruptedException ignore) {
        }
    }
    return false;
}

18 Source : SparkSubmitJob.java
with Apache License 2.0
from apache

@Override
public void execute(JobExecutionContext context) {
    JobDetail jd = context.getJobDetail();
    try {
        if (isNeedLivyQueue) {
            // livy batch limit
            livyTaskSubmitHelper.addTaskToWaitingQueue(jd);
        } else {
            saveJobInstance(jd);
        }
    } catch (Exception e) {
        LOGGER.error("Post spark task ERROR.", e);
    }
}

See More Examples