Commit 0e96a8684b594f66ae4a362141be444b4ce59878

Authored by Rui Fernandes
1 parent 748addb3a7
Exists in master

findbug review

alfresco-trashcan-cleaner-amp/src/main/java/org/alfresco/schedule/ScheduledJobLockExecuter.java
... ... @@ -46,6 +46,11 @@ import org.quartz.JobExecutionException;
46 46 * method of this class will execute the job taking care of all cluster aware
47 47 * lockings.
48 48 *
  49 + * This code is based on original code by Derek Hurley on
  50 + * {@link org.alfresco.repo.content.cleanup.ContentStoreCleaner
  51 + * ContentStoreCleaner}. Extracting the generic locking code in order to be
  52 + * reused and avoid code duplication.
  53 + *
49 54 * @author Rui Fernandes
50 55 *
51 56 */
... ... @@ -67,8 +72,11 @@ public class ScheduledJobLockExecuter
67 72 * @param jobLockService
68 73 * the {@link org.alfresco.repo.lock.JobLockService
69 74 * JobLockService}
70   - * @param name the name of the job to be used for the lock registry
71   - * @param job the {@link org.alfresco.schedule.AbstractScheduledLockedJob job} to be executed
  75 + * @param name
  76 + * the name of the job to be used for the lock registry
  77 + * @param job
  78 + * the {@link org.alfresco.schedule.AbstractScheduledLockedJob
  79 + * job} to be executed
72 80 */
73 81 public ScheduledJobLockExecuter(JobLockService jobLockService, String name,
74 82 AbstractScheduledLockedJob job)
... ... @@ -153,6 +161,11 @@ public class ScheduledJobLockExecuter
153 161 jobLockService.refreshLock(lockToken, lockQName, LOCK_TTL);
154 162 lastLock = System.currentTimeMillis();
155 163 lockPair = new Pair<Long, String>(lastLock, lockToken);
  164 + // I think it was missing the following code line, on the
  165 + // original
  166 + // org.alfresco.repo.content.cleanup.ContentStoreCleaner locking
  167 + // code - Rui Fernandes
  168 + lockThreadLocal.set(lockPair);
156 169 }
157 170 }
158 171 }
... ...