/** * <p> * Retrieve the identified <code>float</code> value from the <code>JobDataMap</code>. * </p> * * @throws ClassCastException * if the identified object is not a String or Float. */ public float getFloatValue(String key) { Object obj = get(key); if(obj instanceof String) { return getFloatValueFromString(key); } else { return getFloat(key); } }
JobDetail job = JobBuilder.newJob(TestJob.class) .withIdentity("testJob") .build(); job.getJobDataMap().put("mobile", "1234567890"); job.getJobDataMap().put("msg", "Your balance is low"); public void execute(JobExecutionContext jExeCtx) throws JobExecutionException { try { JobDataMap dataMap = context.getJobDetail().getJobDataMap(); String msg = dataMap.getString("msg"); String mobile = dataMap.getFloat("mobile"); SendSms.sendSms(mobile,msg); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } log.debug("TestJob run successfully..."); }
/** * <p> * Retrieve the identified <code>float</code> value from the <code>JobDataMap</code>. * </p> * * @throws ClassCastException * if the identified object is not a String or Float. */ public float getFloatValue(String key) { Object obj = get(key); if(obj instanceof String) { return getFloatValueFromString(key); } else { return getFloat(key); } }
/** * <p> * Retrieve the identified <code>float</code> value from the <code>JobDataMap</code>. * </p> * * @throws ClassCastException * if the identified object is not a String or Float. */ public float getFloatValue(String key) { Object obj = get(key); if(obj instanceof String) { return getFloatValueFromString(key); } else { return getFloat(key); } }
/** * <p> * Retrieve the identified <code>float</code> value from the <code>JobDataMap</code>. * </p> * * @throws ClassCastException * if the identified object is not a String or Float. */ public float getFloatValue(String key) { Object obj = get(key); if(obj instanceof String) { return getFloatValueFromString(key); } else { return getFloat(key); } }