public void setKey(JobKey key) { if(key == null) throw new IllegalArgumentException("Key cannot be null!"); setName(key.getName()); setGroup(key.getGroup()); this.key = key; }
public void setKey(JobKey key) { if(key == null) throw new IllegalArgumentException("Key cannot be null!"); setName(key.getName()); setGroup(key.getGroup()); this.key = key; }
/** * <p> * Create a <code>JobDetail</code> with the given name, group and class, * and the default settings of all the other properties. * </p> * * @param group if <code>null</code>, Scheduler.DEFAULT_GROUP will be used. * * @exception IllegalArgumentException * if name is null or empty, or the group is an empty string. * * @deprecated use {@link JobBuilder} */ public JobDetailImpl(String name, String group, Class<? extends Job> jobClass) { setName(name); setGroup(group); setJobClass(jobClass); }
/** * <p> * Create a <code>JobDetail</code> with the given name, group and class, * and the default settings of all the other properties. * </p> * * @param group if <code>null</code>, Scheduler.DEFAULT_GROUP will be used. * * @exception IllegalArgumentException * if name is null or empty, or the group is an empty string. * * @deprecated use {@link JobBuilder} */ public JobDetailImpl(String name, String group, Class<? extends Job> jobClass) { setName(name); setGroup(group); setJobClass(jobClass); }
@Override public void afterPropertiesSet() { Assert.notNull(this.jobClass, "Property 'jobClass' is required"); if (this.name == null) { this.name = this.beanName; } if (this.group == null) { this.group = Scheduler.DEFAULT_GROUP; } if (this.applicationContextJobDataKey != null) { if (this.applicationContext == null) { throw new IllegalStateException( "JobDetailBean needs to be set up in an ApplicationContext " + "to be able to handle an 'applicationContextJobDataKey'"); } getJobDataMap().put(this.applicationContextJobDataKey, this.applicationContext); } JobDetailImpl jdi = new JobDetailImpl(); jdi.setName(this.name != null ? this.name : toString()); jdi.setGroup(this.group); jdi.setJobClass(this.jobClass); jdi.setJobDataMap(this.jobDataMap); jdi.setDurability(this.durability); jdi.setRequestsRecovery(this.requestsRecovery); jdi.setDescription(this.description); this.jobDetail = jdi; }
@Override @SuppressWarnings("unchecked") public void afterPropertiesSet() throws ClassNotFoundException, 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. Class<?> jobClass = (this.concurrent ? MethodInvokingJob.class : StatefulMethodInvokingJob.class); // Build JobDetail instance. JobDetailImpl jdi = new JobDetailImpl(); jdi.setName(name != null ? name : toString()); jdi.setGroup(this.group); jdi.setJobClass((Class) jobClass); jdi.setDurability(true); jdi.getJobDataMap().put("methodInvoker", this); this.jobDetail = jdi; postProcessJobDetail(this.jobDetail); }
/** * @param cData * @return JobDetail */ public static JobDetail newJobDetail(CompositeData cData) throws ClassNotFoundException { JobDetailImpl jobDetail = new JobDetailImpl(); int i = 0; jobDetail.setName((String) cData.get(ITEM_NAMES[i++])); jobDetail.setGroup((String) cData.get(ITEM_NAMES[i++])); jobDetail.setDescription((String) cData.get(ITEM_NAMES[i++])); Class<?> jobClass = Class.forName((String) cData.get(ITEM_NAMES[i++])); @SuppressWarnings("unchecked") Class<? extends Job> jobClassTyped = (Class<? extends Job>)jobClass; jobDetail.setJobClass(jobClassTyped); jobDetail.setJobDataMap(JobDataMapSupport.newJobDataMap((TabularData) cData.get(ITEM_NAMES[i++]))); jobDetail.setDurability((Boolean) cData.get(ITEM_NAMES[i++])); jobDetail.setRequestsRecovery((Boolean) cData.get(ITEM_NAMES[i++])); return jobDetail; }
jobDetail.setGroup((String) attrMap.get(ITEM_NAMES[i++])); jobDetail.setDescription((String) attrMap.get(ITEM_NAMES[i++])); Class<?> jobClass = Class.forName((String) attrMap.get(ITEM_NAMES[i++]));
@Override @SuppressWarnings("unchecked") public void afterPropertiesSet() throws ClassNotFoundException, 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. Class<?> jobClass = (this.concurrent ? MethodInvokingJob.class : StatefulMethodInvokingJob.class); // Build JobDetail instance. JobDetailImpl jdi = new JobDetailImpl(); jdi.setName(name != null ? name : toString()); jdi.setGroup(this.group); jdi.setJobClass((Class) jobClass); jdi.setDurability(true); jdi.getJobDataMap().put("methodInvoker", this); this.jobDetail = jdi; postProcessJobDetail(this.jobDetail); }
JobDetailImpl job = new JobDetailImpl(); job.setName(rs.getString(1)); job.setGroup(rs.getString(2)); job.setDurability(getBoolean(rs, 3)); if (loadJobClass)
JobDetailImpl job = new JobDetailImpl(); job.setName(rs.getString(1)); job.setGroup(rs.getString(2)); job.setDurability(getBoolean(rs, 3)); if (loadJobClass)
/** * <p> * Create a <code>JobDetail</code> with the given name, and group, and * the given settings of all the other properties. * </p> * * @param group if <code>null</code>, Scheduler.DEFAULT_GROUP will be used. * * @exception IllegalArgumentException * if name is null or empty, or the group is an empty string. * * @deprecated use {@link JobBuilder} */ public JobDetailImpl(String name, String group, Class<? extends Job> jobClass, boolean durability, boolean recover) { setName(name); setGroup(group); setJobClass(jobClass); setDurability(durability); setRequestsRecovery(recover); }
/** * <p> * Create a <code>JobDetail</code> with the given name, and group, and * the given settings of all the other properties. * </p> * * @param group if <code>null</code>, Scheduler.DEFAULT_GROUP will be used. * * @exception IllegalArgumentException * if name is null or empty, or the group is an empty string. * * @deprecated use {@link JobBuilder} */ public JobDetailImpl(String name, String group, Class<? extends Job> jobClass, boolean durability, boolean recover) { setName(name); setGroup(group); setJobClass(jobClass); setDurability(durability); setRequestsRecovery(recover); }
@Override public void afterPropertiesSet() { Assert.notNull(this.jobClass, "Property 'jobClass' is required"); if (this.name == null) { this.name = this.beanName; } if (this.group == null) { this.group = Scheduler.DEFAULT_GROUP; } if (this.applicationContextJobDataKey != null) { if (this.applicationContext == null) { throw new IllegalStateException( "JobDetailBean needs to be set up in an ApplicationContext " + "to be able to handle an 'applicationContextJobDataKey'"); } getJobDataMap().put(this.applicationContextJobDataKey, this.applicationContext); } JobDetailImpl jdi = new JobDetailImpl(); jdi.setName(this.name != null ? this.name : toString()); jdi.setGroup(this.group); jdi.setJobClass(this.jobClass); jdi.setJobDataMap(this.jobDataMap); jdi.setDurability(this.durability); jdi.setRequestsRecovery(this.requestsRecovery); jdi.setDescription(this.description); this.jobDetail = jdi; }
job.setGroup(rs.getString(COL_JOB_GROUP)); job.setDescription(rs.getString(COL_DESCRIPTION)); job.setJobClass( loadHelper.loadClass(rs.getString(COL_JOB_CLASS), Job.class));
job.setGroup(rs.getString(COL_JOB_GROUP)); job.setDescription(rs.getString(COL_DESCRIPTION)); job.setJobClass( loadHelper.loadClass(rs.getString(COL_JOB_CLASS), Job.class));
@Override @JsonProperty("group") public void setGroup(String group) { super.setGroup(group); }
public synchronized void start() throws ParseException, SchedulerException { this.jobDetail = new JobDetailImpl(); this.jobDetail.setGroup( this.group ); this.jobDetail.setName( this.name ); this.jobDetail.setDescription( this.description ); this.jobDetail.setJobClass( this.jobClass ); this.jobDetail.setRequestsRecovery( true ); this.jobDetail.getJobDataMap().put("timeout", timeout); CronTrigger trigger = new CronTriggerImpl( getTriggerName(), this.group, this.cronExpression ); Scheduler scheduler = getScheduler(); scheduler.scheduleJob( jobDetail, trigger ); }
@Override @SuppressWarnings("unchecked") public void afterPropertiesSet() throws ClassNotFoundException, 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. Class<?> jobClass = (this.concurrent ? MethodInvokingJob.class : StatefulMethodInvokingJob.class); // Build JobDetail instance. JobDetailImpl jdi = new JobDetailImpl(); jdi.setName(name); jdi.setGroup(this.group); jdi.setJobClass((Class) jobClass); jdi.setDurability(true); jdi.getJobDataMap().put("methodInvoker", this); this.jobDetail = jdi; postProcessJobDetail(this.jobDetail); }
public CouchDbJobDetail(JobDetail newJob) { this(); if (newJob instanceof JobDetailImpl) { super.setName(((JobDetailImpl) newJob).getName()); super.setGroup(((JobDetailImpl) newJob).getGroup()); } else if (newJob instanceof CouchDbJobDetail) { super.setName((((CouchDbJobDetail) newJob).getName())); super.setGroup(((CouchDbJobDetail) newJob).getGroup()); } super.setDescription(newJob.getDescription()); super.setJobClass(newJob.getJobClass()); super.setDurability(newJob.isDurable()); super.setRequestsRecovery(newJob.requestsRecovery()); super.setJobDataMap((JobDataMap) newJob.getJobDataMap().clone()); }