@Override protected String getValue(T key) { return key.getGroup(); }
public int compareTo(Key<T> o) { if(group.equals(DEFAULT_GROUP) && !o.group.equals(DEFAULT_GROUP)) return -1; if(!group.equals(DEFAULT_GROUP) && o.group.equals(DEFAULT_GROUP)) return 1; int r = group.compareTo(o.getGroup()); if(r != 0) return r; return name.compareTo(o.getName()); }
/** * <p> * Return the string representation of the key. The format will be: * <group>.<name>. * </p> * * @return the string representation of the key */ @Override public String toString() { return getGroup() + '.' + getName(); }
public int compareTo(Key<T> o) { if(group.equals(DEFAULT_GROUP) && !o.group.equals(DEFAULT_GROUP)) return -1; if(!group.equals(DEFAULT_GROUP) && o.group.equals(DEFAULT_GROUP)) return 1; int r = group.compareTo(o.getGroup()); if(r != 0) return r; return name.compareTo(o.getName()); }
/** * <p> * Return the string representation of the key. The format will be: * <group>.<name>. * </p> * * @return the string representation of the key */ @Override public String toString() { return getGroup() + '.' + getName(); }
@Override protected String getValue(T key) { return key.getGroup(); }
/** * <p> * Return the string representation of the key. The format will be: * <group>.<name>. * </p> * * @return the string representation of the key */ public String toString() { return getGroup() + '.' + getName(); } }
/** * <p> * Return the string representation of the key. The format will be: * <group>.<name>. * </p> * * @return the string representation of the key */ public String toString() { return getGroup() + '.' + getName(); } }
public static String desc(Key<?> key) { return key.getGroup().equals(Scheduler.DEFAULT_GROUP) ? key.getName() : key.toString(); } }
protected BasicDBObject keyAsDBObject(Key key) { BasicDBObject job = new BasicDBObject(); job.put(JOB_KEY_NAME, key.getName()); job.put(JOB_KEY_GROUP, key.getGroup()); return job; }
public void jobWasExecuted(JobExecutionContext context, JobExecutionException jobException) { Key sj = (Key) chainLinks.get(context.getJobDetail().getKey()); if(sj == null) { return; } getLog().info("Job '" + context.getJobDetail().getFullName() + "' will now chain to Job '" + sj + "'"); try { if(context.getJobDetail().isVolatile() || context.getTrigger().isVolatile()) { context.getScheduler().triggerJobWithVolatileTrigger(sj.getName(), sj.getGroup()); } else { context.getScheduler().triggerJob(sj.getName(), sj.getGroup()); } } catch(SchedulerException se) { getLog().error("Error encountered during chaining to Job '" + sj + "'", se); } } }
public void jobWasExecuted(JobExecutionContext context, JobExecutionException jobException) { Key sj = (Key) chainLinks.get(context.getJobDetail().getKey()); if(sj == null) { return; } getLog().info("Job '" + context.getJobDetail().getFullName() + "' will now chain to Job '" + sj + "'"); try { if(context.getJobDetail().isVolatile() || context.getTrigger().isVolatile()) { context.getScheduler().triggerJobWithVolatileTrigger(sj.getName(), sj.getGroup()); } else { context.getScheduler().triggerJob(sj.getName(), sj.getGroup()); } } catch(SchedulerException se) { getLog().error("Error encountered during chaining to Job '" + sj + "'", se); } } }
retrieveTrigger(conn, triggerKey.getName(), triggerKey.getGroup());
protected boolean removeJob(Connection conn, SchedulingContext ctxt, String jobName, String groupName, boolean activeDeleteSafe) throws JobPersistenceException { try { Key[] jobTriggers = getDelegate().selectTriggerNamesForJob(conn, jobName, groupName); for (int i = 0; i < jobTriggers.length; ++i) { deleteTriggerAndChildren( conn, jobTriggers[i].getName(), jobTriggers[i].getGroup()); } return deleteJobAndChildren(conn, ctxt, jobName, groupName); } catch (SQLException e) { throw new JobPersistenceException("Couldn't remove job: " + e.getMessage(), e); } }
retrieveTrigger(conn, triggerKey.getName(), triggerKey.getGroup());
protected boolean removeJob(Connection conn, SchedulingContext ctxt, String jobName, String groupName, boolean activeDeleteSafe) throws JobPersistenceException { try { Key[] jobTriggers = getDelegate().selectTriggerNamesForJob(conn, jobName, groupName); for (int i = 0; i < jobTriggers.length; ++i) { deleteTriggerAndChildren( conn, jobTriggers[i].getName(), jobTriggers[i].getGroup()); } return deleteJobAndChildren(conn, ctxt, jobName, groupName); } catch (SQLException e) { throw new JobPersistenceException("Couldn't remove job: " + e.getMessage(), e); } }
/** * Build the cron trigger * * @return The trigger * @throws Exception */ public Trigger getTrigger() throws Exception { Trigger trigger = new CronTrigger(getBeanName(), Scheduler.DEFAULT_GROUP, getCronExpression()); if (this.startDelay > 0) { trigger.setStartTime(new Date(System.currentTimeMillis() + this.startDelay)); } JobDetail jd = super.getJobDetail(); if (jd != null) { String jobName = super.getJobDetail().getKey().getName(); if (jobName != null && !jobName.isEmpty()) { trigger.setJobName(jobName); } String jobGroup = super.getJobDetail().getKey().getGroup(); if (jobGroup != null && !jobGroup.isEmpty()) { trigger.setJobGroup(jobGroup); } } return trigger; }