code: private TaskWorkerInfo getTaskWorker(UUID jobId) throws ClassNotFoundException {
  
      /* First try to get the worker from the local map. */
      TaskWorkerInfo info;
      synchronized (workerMap) {
        info = workerMap.get(jobId);
        if (info == null) {
          info = new TaskWorkerInfo();
          workerMap.put(jobId, info);
        }
      }
  
      synchronized (info) {
        if (info.worker == null) {
  
          /* The task worker was not in the cache, so use the service to
           * obtain the task worker.
           */
          Serialized<TaskWorker> envelope = this.service.getTaskWorker(jobId);
  
          ClassLoaderStrategy strategy;
          if (dataSource != null) {
            strategy = new DbCachingJobServiceClassLoaderStrategy(
                service, jobId, dataSource);
          } else {
            strategy = new InternalCachingJobServiceClassLoaderStrategy(
                service, jobId);
          }
  
          info.loader = new StrategyClassLoader(
              strategy, ThreadServiceWorker.class.getClassLoader());
          info.worker = envelope.deserialize(info.loader);
  
          if (logger.isInfoEnabled()) {
            logger.info(String.format(
                "Got worker (thread=%d)", Thread.currentThread().getId()));
          }
  
        }
      }
  
      assert(info.worker != null);
      return info;
  
    }
docs: Obtains the task worker to process tasks for the job with the specified
  <code>UUID</code>.
  @param jobId The <code>UUID</code> of the job to obtain the task worker
  for.
  @return The <code>TaskWorkerInfo</code> to process tasks for the job with
  the specified <code>UUID</code>, or <code>null</code> if the job
  is invalid or has already been completed.
  @throws ClassNotFoundException