Tabnine Logo
Scheduler.addJob
Code IndexAdd Tabnine to your IDE (free)

How to use
addJob
method
in
org.quartz.core.Scheduler

Best Java code snippets using org.quartz.core.Scheduler.addJob (Showing top 6 results out of 315)

origin: org.knowm/sundial

/**
 * Adds a Job to the scheduler. Replaces a matching existing Job.
 *
 * @param jobName
 * @param jobClass
 * @param params Set this null if there are no params
 * @param isConcurrencyAllowed
 */
public static void addJob(String jobName, Class<? extends Job> jobClass, Map<String, Object> params, boolean isConcurrencyAllowed)
  throws SundialSchedulerException {
 try {
  JobDataMap jobDataMap = new JobDataMap();
  if (params != null) {
   for (Entry<String, Object> entry : params.entrySet()) {
    jobDataMap.put(entry.getKey(), entry.getValue());
   }
  }
  JobDetail jobDetail = newJobBuilder(jobClass).withIdentity(jobName).usingJobData(jobDataMap).isConcurrencyAllowed(isConcurrencyAllowed).build();
  getScheduler().addJob(jobDetail);
 } catch (SchedulerException e) {
  logger.error("ERROR ADDING JOB!!!", e);
  throw new SundialSchedulerException("ERROR ADDING JOB!!!", e);
 }
}
origin: com.xeiam/sundial

logger.info("Scheduled job: {} ", jobDetail);
sched.addJob(jobDetail);
origin: org.knowm/sundial

logger.info("Scheduled job: {} ", jobDetail);
sched.addJob(jobDetail);
origin: com.xeiam/sundial

/**
 * Adds a Job to the scheduler. Replaces a matching existing Job.
 *
 * @param jobName
 * @param jobClassName
 * @param params Set this null if there are no params
 * @param isConcurrencyAllowed
 */
public static void addJob(String jobName, String jobClassName, Map<String, Object> params, boolean isConcurrencyAllowed) {
 try {
  Class<? extends Job> jobClass = getScheduler().getCascadingClassLoadHelper().loadClass(jobClassName);
  JobDataMap jobDataMap = new JobDataMap();
  if (params != null) {
   for (Entry<String, Object> entry : params.entrySet()) {
    jobDataMap.put(entry.getKey(), entry.getValue());
   }
  }
  JobDetail jobDetail = newJobBuilder(jobClass).withIdentity(jobName).usingJobData(jobDataMap).isConcurrencyAllowed(isConcurrencyAllowed).build();
  getScheduler().addJob(jobDetail);
 } catch (SchedulerException e) {
  logger.error("ERROR ADDING JOB!!!", e);
 } catch (ClassNotFoundException e) {
  logger.error("ERROR ADDING JOB!!!", e);
 }
}
origin: knowm/Sundial

logger.info("Scheduled job: {} ", jobDetail);
sched.addJob(jobDetail);
origin: knowm/Sundial

    .build();
getScheduler().addJob(jobDetail);
org.quartz.coreScheduleraddJob

Javadoc

Add the given Job to the Scheduler - with no associated Trigger. The Job will be 'dormant' until it is scheduled with a Trigger, or Scheduler.triggerJob() is called for it.

The Job must by definition be 'durable', if it is not, SchedulerException will be thrown.

Popular methods of Scheduler

  • getTrigger
    Get the Trigger instance with the given key. The returned Trigger object will be a snap-shot of the
  • deleteJob
    Delete the identified Job from the Scheduler - and any associated Triggers.
  • getCascadingClassLoadHelper
  • getCurrentlyExecutingJobs
    Return a list of JobExecutionContext objects that represent all currently executing Jobs in this Sch
  • getJobKeys
    Get the keys of all the org.quartz.jobs.JobDetails in the matching groups.
  • getTriggersOfJob
    Get all Trigger s that are associated with the identified org.quartz.jobs.JobDetail. The returned T
  • rescheduleJob
    Remove (delete) the org.quartz.triggers.OperableTrigger with the given key, and store the new given
  • scheduleJob
    Schedule the given org.quartz.triggers.OperableTrigger with the Job identified by the Trigger's sett
  • shutdown
    Halts the Scheduler's firing of Triggers, and cleans up all resources associated with the Scheduler.
  • start
    Starts the Scheduler's threads that fire Triggers. When a scheduler is first created it is in "stand
  • startDelayed
    Calls {#start()} after the indicated number of seconds. (This call does not block). This can be usef
  • triggerJob
    Trigger the identified org.quartz.jobs.JobDetail (execute it now).
  • startDelayed,
  • triggerJob,
  • unscheduleJob,
  • getListenerManager

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (ScheduledExecutorService)
  • requestLocationUpdates (LocationManager)
  • startActivity (Activity)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • Socket (java.net)
    Provides a client-side TCP socket.
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Notification (javax.management)
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now