@Override
  public void storeJob(JobDetail newJob, boolean replaceExisting)
      throws ObjectAlreadyExistsException {

    JobWrapper jw = new JobWrapper((JobDetail) newJob.clone());

    boolean repl = false;

    synchronized (lock) {
      if (jobsByKey.get(jw.key) != null) {
        if (!replaceExisting) {
          throw new ObjectAlreadyExistsException(newJob);
        }
        repl = true;
      }

      if (!repl) {

        // add to jobs by FQN map
        jobsByKey.put(jw.key, jw);
      } else {
        // update job detail
        JobWrapper orig = jobsByKey.get(jw.key);
        orig.jobDetail = jw.jobDetail; // already cloned
      }
    }
  }
@ Override public void storeJob ( JobDetail newJob , boolean replaceExisting ) throws ObjectAlreadyExistsException { JobWrapper jw = new JobWrapper ( ( JobDetail ) newJob . clone ( ) ) ; boolean repl = false ; synchronized ( lock ) { if ( jobsByKey . get ( jw . key ) != null ) { if ( ! replaceExisting ) { throw new ObjectAlreadyExistsException ( newJob ) ; } repl = true ; } if ( ! repl ) { jobsByKey . put ( jw . key , jw ) ; } else { JobWrapper orig = jobsByKey . get ( jw . key ) ; orig . jobDetail = jw . jobDetail ; } } }
Store the given <code>{@link org.quartz.jobs.Job}</code>.

@param newJob The <code>Job</code> to be stored.
@param replaceExisting If <code>true</code>, any <code>Job</code> existing in the <code>
JobStore</code> with the same name & group should be over-written.
@throws ObjectAlreadyExistsException if a <code>Job</code> with the same name/group already
exists, and replaceExisting is set to false.