if (resources == null) {
resources = new HashMap<String, Object>();
}
JobDetail jobDetail = new JobDetail();
jobDetail.setJobClass(jobClass);
String name = taskDescription.getName();
if (name == null || "".equals(name)) {
throw new SynapseTaskException("Name cannot be found.", log);
}
jobDetail.setName(name);
String group = taskDescription.getGroup();
if (group != null && !"".equals(group)) {
jobDetail.setGroup(group);
} else {
jobDetail.setGroup(TaskDescription.DEFAULT_GROUP);
}
JobDataMap jobDataMap = new JobDataMap(resources);
String className = taskDescription.getTaskClass();
if (className != null && !"".equals(className)) {
jobDataMap.put(TaskDescription.CLASSNAME, className);
}
Set xmlProperties = taskDescription.getProperties();
if (xmlProperties != null) {
jobDataMap.put(TaskDescription.PROPERTIES, xmlProperties);
}
jobDetail.setJobDataMap(jobDataMap);
return jobDetail;
}