1 31 32 package org.opencms.staticexport; 33 34 import org.opencms.main.CmsLog; 35 import org.opencms.main.OpenCms; 36 import org.opencms.report.I_CmsReport; 37 import org.opencms.util.CmsUUID; 38 39 import org.apache.commons.logging.Log; 40 41 55 public abstract class A_CmsOnDemandStaticExportHandler extends A_CmsStaticExportHandler 56 implements I_CmsStaticExportHandler { 57 58 59 private static final Log LOG = CmsLog.getLog(A_CmsOnDemandStaticExportHandler.class); 60 61 64 public void performEventPublishProject(CmsUUID publishHistoryId, I_CmsReport report) { 65 66 int count = 0; 67 while ((count < CmsStaticExportManager.HANDLER_FINISH_TIME) && isBusy()) { 69 count++; 70 try { 71 if (LOG.isInfoEnabled()) { 72 LOG.info(Messages.get().getBundle().key( 73 Messages.LOG_WAITING_STATIC_EXPORT_3, 74 getClass().getName(), 75 new Integer (count), 76 new Integer (CmsStaticExportManager.HANDLER_FINISH_TIME))); 77 } 78 Thread.sleep(1000); 79 } catch (InterruptedException e) { 80 count = CmsStaticExportManager.HANDLER_FINISH_TIME; 82 } 83 } 84 85 if (isBusy()) { 86 Object [] arguments = new Object [] { 88 publishHistoryId, 89 new Integer (CmsStaticExportManager.HANDLER_FINISH_TIME)}; 90 LOG.error(Messages.get().getBundle().key(Messages.LOG_SCRUBBING_FOLDER_FAILED_2, arguments)); 91 92 return; 93 } 94 95 final CmsUUID id = publishHistoryId; 96 97 if (OpenCms.getRunLevel() >= OpenCms.RUNLEVEL_1_CORE_OBJECT) { 98 m_busy = true; 100 Thread t = new Thread (new Runnable () { 101 102 public void run() { 103 104 try { 105 scrubExportFolders(id); 106 } finally { 107 m_busy = false; 108 } 109 } 110 }, Messages.get().getBundle().key(Messages.GUI_THREAD_NAME_SCRUB_EXPORT_FOLDERS_1, String.valueOf(id))); 111 t.start(); 112 } 113 } 114 } | Popular Tags |