1 17 package org.alfresco.repo.content.cleanup; 18 19 import org.alfresco.error.AlfrescoRuntimeException; 20 import org.quartz.Job; 21 import org.quartz.JobDataMap; 22 import org.quartz.JobExecutionContext; 23 import org.quartz.JobExecutionException; 24 25 36 public class ContentStoreCleanupJob implements Job 37 { 38 public ContentStoreCleanupJob() 39 { 40 } 41 42 45 public void execute(JobExecutionContext context) throws JobExecutionException 46 { 47 JobDataMap jobData = context.getJobDetail().getJobDataMap(); 48 Object contentStoreCleanerObj = jobData.get("contentStoreCleaner"); 50 if (contentStoreCleanerObj == null || !(contentStoreCleanerObj instanceof ContentStoreCleaner)) 51 { 52 throw new AlfrescoRuntimeException( 53 "ContentStoreCleanupJob data must contain valid 'contentStoreCleaner' reference"); 54 } 55 ContentStoreCleaner contentStoreCleaner = (ContentStoreCleaner) contentStoreCleanerObj; 56 contentStoreCleaner.execute(); 57 } 58 } 59 | Popular Tags |