Source:
public Job buildJobExecutor(String jobId, Props jobProps, Logger logger) throws JobTypeManagerException { final JobTypePluginSet pluginSet = getJobTypePluginSet(); Job job = null; try { String jobType = jobProps.getString("type"); if (jobType == null || jobType.length() == 0) { throw new JobExecutionException(String.format( "The 'type' parameter for job[%s] is null or empty", jobProps, logger)); } logger.info("Building " + jobType + " job executor. "); Class<? extends Object> executorClass = pluginSet.getPluginClass(jobType); if (executorClass == null) { throw new JobExecutionException(String.format("Job type '" + jobType + "' is unrecognized. Could not construct job[%s] of type[%s].", jobProps, jobType)); } Props pluginJobProps = pluginSet.getPluginJobProps(jobType); if (pluginJobProps != null) { for (String k : pluginJobProps.getKeySet()) { if (!jobProps.containsKey(k)) { jobProps.put(k, pluginJobProps.get(k)); } } } jobProps = PropsUtils.resolveProps(jobProps); Props pluginLoadProps = pluginSet.getPluginLoaderProps(jobType); if (pluginLoadProps != null) { pluginLoadProps = PropsUtils.resolveProps(pluginLoadProps); } else { pluginLoadProps = pluginSet.getCommonPluginLoadProps(); } job = (Job) Utils.callConstructor(executorClass, jobId, pluginLoadProps, jobProps, logger); } catch (Exception e) { logger.error("Failed to build job executor for job " + jobId + e.getMessage()); throw new JobTypeManagerException("Failed to build job executor for job " + jobId, e); } catch (Throwable t) { logger.error( "Failed to build job executor for job " + jobId + t.getMessage(), t); throw new JobTypeManagerException("Failed to build job executor for job " + jobId, t); } return job; }

Target:
public Job buildJobExecutor(String jobId, Props jobProps, Logger logger) throws JobTypeManagerException { final JobTypePluginSet pluginSet = getJobTypePluginSet(); Job job = null; try { String jobType = jobProps.getString("type"); if (jobType == null || jobType.length() == 0) { throw new JobExecutionException(String.format( "The 'type' parameter for job[%s] is null or empty", jobProps, logger)); } logger.info("Building " + jobType + " job executor. "); Class<? extends Object> executorClass = pluginSet.getPluginClass(jobType); if (executorClass == null) { throw new JobExecutionException(String.format("Job type '" + jobType + "' is unrecognized. Could not construct job[%s] of type[%s].", jobProps, jobType)); } Props pluginJobProps = pluginSet.getPluginJobProps(jobType); if (pluginJobProps != null) { for (String k : pluginJobProps.getKeySet()) { if (!jobProps.containsKey(k)) { jobProps.put(k, pluginJobProps.get(k)); } } } jobProps = PropsUtils.resolveProps(jobProps); Props pluginLoadProps = pluginSet.getPluginLoaderProps(jobType); if (pluginLoadProps != null) { pluginLoadProps = PropsUtils.resolveProps(pluginLoadProps); } else { pluginLoadProps = pluginSet.getCommonPluginLoadProps(); if(pluginJobProps == null) pluginJobProps = new Props(); } job = (Job) Utils.callConstructor(executorClass, jobId, pluginLoadProps, jobProps, logger); } catch (Exception e) { logger.error("Failed to build job executor for job " + jobId + e.getMessage()); throw new JobTypeManagerException("Failed to build job executor for job " + jobId, e); } catch (Throwable t) { logger.error( "Failed to build job executor for job " + jobId + t.getMessage(), t); throw new JobTypeManagerException("Failed to build job executor for job " + jobId, t); } return job; }