code: public static Object materializeJob(final Job job, final Map<String, Class<?>> jobTypes)
              throws UnpermittedJobException, Exception {
          final String className = job.getClassName();
          final Class<?> clazz = jobTypes.get(className);
          if (clazz == null) {
              throw new UnpermittedJobException(className);
          }
          // A bit redundant since we check when the job type is added...
          if (!Runnable.class.isAssignableFrom(clazz) && !Callable.class.isAssignableFrom(clazz)) {
              throw new ClassCastException("jobs must be a Runnable or a Callable: " + clazz.getName() + " - " + job);
          }
          return ReflectionUtils.createObject(clazz, job.getArgs(), job.getVars());
      }
docs: Materializes a job by looking up {@link Job#getClassName()} in the
  provided map of job types.
  
  @param job
  the job to materialize
  @param jobTypes
  a map of String names to Java types
  @return the materialized job
  @throws UnpermittedJobException
  if there was not a non-null mapping in jobTypes for the class
  name
  @throws Exception
  if there was an exception creating the object