Пример #1
0
 @Override
 public void delete(Long scheduleId, Long id) {
   super.delete(scheduleId, id);
   Object entityCacheKey = getEntityCacheKey(Job.class, getJobWideUniqueData(scheduleId, id));
   cache.remove(entityCacheKey);
   abandonScheduleCache(scheduleId);
 }
Пример #2
0
  @SuppressWarnings("unchecked")
  @Override
  public void update(Job job, boolean commitAfter) {
    super.update(job, commitAfter);
    Object entityCacheKey = getEntityCacheKey(Job.class, getJobWideUniqueData(job.getKey()));

    Job cachedJob = (Job) cache.get(entityCacheKey);

    if (cachedJob != null) {

      if (!cachedJob.getCronString().equals(job.getCronString())) {
        abandonJobsByCronStringCache(cachedJob.getCronString());
        abandonJobsByCronStringCache(job.getCronString());
      }

      cache.put(entityCacheKey, job);
    } else {
      abandonJobsByCronStringCache();
    }

    updateJobInScheduleCache(job);
  }