Tabnine Logo
Trigger
Code IndexAdd Tabnine to your IDE (free)

How to use
Trigger
in
org.quartz.triggers

Best Java code snippets using org.quartz.triggers.Trigger (Showing top 20 results out of 315)

origin: org.knowm/sundial

/**
 * <p>
 * Create a <code>ObjectAlreadyExistsException</code> and auto-generate a message using the name/group from the given <code>Trigger</code>.
 * </p>
 * <p>
 * The message will read: <BR>
 * "Unable to store Trigger with name: '__' and group: '__', because one already exists with this identification."
 * </p>
 */
public ObjectAlreadyExistsException(Trigger offendingTrigger) {
 super("Unable to store Trigger with name: '" + offendingTrigger.getName() + "', because one already exists with this identification.");
}
origin: knowm/Sundial

 @Override
 public int compare(Trigger trig1, Trigger trig2) {
  Date t1 = trig1.getNextFireTime();
  Date t2 = trig2.getNextFireTime();
  if (t1 != null || t2 != null) {
   if (t1 == null) {
    return 1;
   }
   if (t2 == null) {
    return -1;
   }
   if (t1.before(t2)) {
    return -1;
   }
   if (t1.after(t2)) {
    return 1;
   }
  }
  int comp = trig2.getPriority() - trig1.getPriority();
  if (comp != 0) {
   return comp;
  }
  return trig1.getName().compareTo(trig2.getName());
 }
}
origin: org.knowm/sundial

private boolean notifyTriggerListenersComplete(JobExecutionContext jec, CompletedExecutionInstruction instCode) {
 try {
  qs.notifyTriggerListenersComplete(jec, instCode);
 } catch (SchedulerException se) {
  qs.notifySchedulerListenersError("Unable to notify TriggerListener(s) of Job that was executed: " + "(error will be ignored). trigger= "
    + jec.getTrigger().getName() + " job= " + jec.getJobDetail().getName(), se);
  return false;
 }
 if (jec.getTrigger().getNextFireTime() == null) {
  qs.notifySchedulerListenersFinalized(jec.getTrigger());
 }
 return true;
}
origin: com.xeiam/sundial

if (dupeT != null) { // if trigger with name already exists
 if (!dupeT.getJobName().equals(trigger.getJobName())) {
  logger.warn("Possibly duplicately named ({}) triggers in jobs xml file! ", trigger.getName());
origin: mycontroller-org/mycontroller

public static synchronized Long nextFireTime(String _name, Integer _id) {
  String _triggerName = getCronTriggerName(getTimerJobName(_name, _id));
  try {
    return SundialJobScheduler.getScheduler().getTrigger(_triggerName).getNextFireTime().getTime();
  } catch (Exception ex) {
    _logger.error("Error when fetching trigger[{}] next exeuction status", _triggerName, ex);
  }
  return null;
}
origin: knowm/Sundial

/** Create a JobExcecutionContext with the given context data. */
public JobExecutionContextImpl(Scheduler scheduler, TriggerFiredBundle firedBundle, Job job) {
 this.scheduler = scheduler;
 this.trigger = firedBundle.getTrigger();
 this.calendar = firedBundle.getCalendar();
 this.jobDetail = firedBundle.getJobDetail();
 this.job = job;
 this.recovering = firedBundle.isRecovering();
 this.fireTime = firedBundle.getFireTime();
 this.scheduledFireTime = firedBundle.getScheduledFireTime();
 this.prevFireTime = firedBundle.getPrevFireTime();
 this.nextFireTime = firedBundle.getNextFireTime();
 this.jobDataMap = new JobDataMap();
 this.jobDataMap.putAll(jobDetail.getJobDataMap());
 this.jobDataMap.putAll(trigger.getJobDataMap());
}
origin: com.xeiam/sundial

private boolean notifyTriggerListenersComplete(JobExecutionContext jec, CompletedExecutionInstruction instCode) {
 try {
  qs.notifyTriggerListenersComplete(jec, instCode);
 } catch (SchedulerException se) {
  qs.notifySchedulerListenersError("Unable to notify TriggerListener(s) of Job that was executed: " + "(error will be ignored). trigger= "
    + jec.getTrigger().getName() + " job= " + jec.getJobDetail().getName(), se);
  return false;
 }
 if (jec.getTrigger().getNextFireTime() == null) {
  qs.notifySchedulerListenersFinalized(jec.getTrigger());
 }
 return true;
}
origin: org.knowm/sundial

if (dupeT != null) { // if trigger with name already exists
 if (!dupeT.getJobName().equals(trigger.getJobName())) {
  logger.warn("Possibly duplicately named ({}) triggers in jobs xml file! ", trigger.getName());
origin: org.mycontroller.standalone/mycontroller-core

public static synchronized Long nextFireTime(String _name, Integer _id) {
  String _triggerName = getCronTriggerName(getTimerJobName(_name, _id));
  try {
    return SundialJobScheduler.getScheduler().getTrigger(_triggerName).getNextFireTime().getTime();
  } catch (Exception ex) {
    _logger.error("Error when fetching trigger[{}] next exeuction status", _triggerName, ex);
  }
  return null;
}
origin: org.knowm/sundial

/**
 * <p>
 * Create a JobExcecutionContext with the given context data.
 * </p>
 */
public JobExecutionContextImpl(Scheduler scheduler, TriggerFiredBundle firedBundle, Job job) {
 this.scheduler = scheduler;
 this.trigger = firedBundle.getTrigger();
 this.calendar = firedBundle.getCalendar();
 this.jobDetail = firedBundle.getJobDetail();
 this.job = job;
 this.recovering = firedBundle.isRecovering();
 this.fireTime = firedBundle.getFireTime();
 this.scheduledFireTime = firedBundle.getScheduledFireTime();
 this.prevFireTime = firedBundle.getPrevFireTime();
 this.nextFireTime = firedBundle.getNextFireTime();
 this.jobDataMap = new JobDataMap();
 this.jobDataMap.putAll(jobDetail.getJobDataMap());
 this.jobDataMap.putAll(trigger.getJobDataMap());
}
origin: com.xeiam/sundial

/**
 * <p>
 * Create a <code>ObjectAlreadyExistsException</code> and auto-generate a message using the name/group from the given <code>Trigger</code>.
 * </p>
 * <p>
 * The message will read: <BR>
 * "Unable to store Trigger with name: '__' and group: '__', because one already exists with this identification."
 * </p>
 */
public ObjectAlreadyExistsException(Trigger offendingTrigger) {
 super("Unable to store Trigger with name: '" + offendingTrigger.getName() + "', because one already exists with this identification.");
}
origin: com.xeiam/sundial

 @Override
 public int compare(Trigger trig1, Trigger trig2) {
  Date t1 = trig1.getNextFireTime();
  Date t2 = trig2.getNextFireTime();
  if (t1 != null || t2 != null) {
   if (t1 == null) {
    return 1;
   }
   if (t2 == null) {
    return -1;
   }
   if (t1.before(t2)) {
    return -1;
   }
   if (t1.after(t2)) {
    return 1;
   }
  }
  int comp = trig2.getPriority() - trig1.getPriority();
  if (comp != 0) {
   return comp;
  }
  return trig1.getName().compareTo(trig2.getName());
 }
}
origin: knowm/Sundial

private boolean notifyTriggerListenersComplete(
  JobExecutionContext jec, CompletedExecutionInstruction instCode) {
 try {
  qs.notifyTriggerListenersComplete(jec, instCode);
 } catch (SchedulerException se) {
  qs.notifySchedulerListenersError(
    "Unable to notify TriggerListener(s) of Job that was executed: "
      + "(error will be ignored). trigger= "
      + jec.getTrigger().getName()
      + " job= "
      + jec.getJobDetail().getName(),
    se);
  return false;
 }
 if (jec.getTrigger().getNextFireTime() == null) {
  qs.notifySchedulerListenersFinalized(jec.getTrigger());
 }
 return true;
}
origin: knowm/Sundial

if (dupeT != null) { // if trigger with name already exists
 if (!dupeT.getJobName().equals(trigger.getJobName())) {
  logger.warn(
    "Possibly duplicately named ({}) triggers in jobs xml file! ", trigger.getName());
origin: com.xeiam/sundial

/**
 * <p>
 * Create a JobExcecutionContext with the given context data.
 * </p>
 */
public JobExecutionContextImpl(Scheduler scheduler, TriggerFiredBundle firedBundle, Job job) {
 this.scheduler = scheduler;
 this.trigger = firedBundle.getTrigger();
 this.calendar = firedBundle.getCalendar();
 this.jobDetail = firedBundle.getJobDetail();
 this.job = job;
 this.recovering = firedBundle.isRecovering();
 this.fireTime = firedBundle.getFireTime();
 this.scheduledFireTime = firedBundle.getScheduledFireTime();
 this.prevFireTime = firedBundle.getPrevFireTime();
 this.nextFireTime = firedBundle.getNextFireTime();
 this.jobDataMap = new JobDataMap();
 this.jobDataMap.putAll(jobDetail.getJobDataMap());
 this.jobDataMap.putAll(trigger.getJobDataMap());
}
origin: knowm/Sundial

 /**
  * Create a <code>ObjectAlreadyExistsException</code> and auto-generate a message using the
  * name/group from the given <code>Trigger</code>.
  *
  * <p>The message will read: <br>
  * "Unable to store Trigger with name: '__' and group: '__', because one already exists with this
  * identification."
  */
 public ObjectAlreadyExistsException(Trigger offendingTrigger) {

  super(
    "Unable to store Trigger with name: '"
      + offendingTrigger.getName()
      + "', because one already exists with this identification.");
 }
}
origin: org.knowm/sundial

 @Override
 public int compare(Trigger trig1, Trigger trig2) {
  Date t1 = trig1.getNextFireTime();
  Date t2 = trig2.getNextFireTime();
  if (t1 != null || t2 != null) {
   if (t1 == null) {
    return 1;
   }
   if (t2 == null) {
    return -1;
   }
   if (t1.before(t2)) {
    return -1;
   }
   if (t1.after(t2)) {
    return 1;
   }
  }
  int comp = trig2.getPriority() - trig1.getPriority();
  if (comp != 0) {
   return comp;
  }
  return trig1.getName().compareTo(trig2.getName());
 }
}
origin: knowm/Sundial

 return null;
} else {
 trig.setJobName(oldTrigger.getJobName());
origin: com.xeiam/sundial

/**
 * Trigger equality is based upon the equality of the Trigger name.
 *
 * @return true if the key of this Trigger equals that of the given Trigger.
 */
@Override
public boolean equals(Object o) {
 if (!(o instanceof Trigger)) {
  return false;
 }
 Trigger other = (Trigger) o;
 if (other.getName() == null || getName() == null) {
  return false;
 }
 return getName().equals(other.getName());
}
origin: com.xeiam/sundial

 return null;
} else {
 trig.setJobName(oldTrigger.getJobName());
org.quartz.triggersTrigger

Javadoc

The base interface with properties common to all Triggers - use TriggerBuilder to instantiate an actual Trigger.

Triggerss have a TriggerKey associated with them, which should uniquely identify them within a single Scheduler.

Triggers are the 'mechanism' by which Jobs are scheduled. Many Triggers can point to the same Job, but a single Trigger can only point to one Job.

Triggers can 'send' parameters/data to Jobs by placing contents into the JobDataMap on the Trigger.

Most used methods

  • getName
    Get the name of this Trigger.
  • getNextFireTime
    Returns the next time at which the Trigger is scheduled to fire. If the trigger will not fire again,
  • getJobDataMap
    Get the JobDataMap that is associated with the Trigger. Changes made to this map during job executio
  • getJobName
    Get the name of the associated org.quartz.jobs.JobDetail.
  • getPriority
    The priority of a Trigger acts as a tiebreaker such that if two Triggers have the same scheduled fir

Popular in Java

  • Making http requests using okhttp
  • getContentResolver (Context)
  • onCreateOptionsMenu (Activity)
  • getResourceAsStream (ClassLoader)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • BoxLayout (javax.swing)
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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