1 16 17 package org.apache.jetspeed.daemon.impl.util.diskcachedaemon; 18 19 import org.apache.jetspeed.om.registry.PortletEntry; 21 import org.apache.jetspeed.services.logging.JetspeedLogFactoryService; 22 import org.apache.jetspeed.services.logging.JetspeedLogger; 23 import org.apache.jetspeed.services.Registry; 24 import org.apache.jetspeed.services.urlmanager.URLFetcher; 25 26 import java.util.Enumeration; 28 29 39 public class URLRefresher implements Runnable { 40 41 private String url = null; 42 43 46 private static final JetspeedLogger logger = JetspeedLogFactoryService.getLogger(URLRefresher.class.getName()); 47 48 51 public URLRefresher( String url ) { 52 53 this.url = url; 54 55 } 56 57 60 public void run() { 61 62 try { 63 64 if(URLFetcher.refresh(url)) { 67 70 71 73 Enumeration enum = Registry.get(Registry.PORTLET).getEntries(); 74 75 while( enum.hasMoreElements() ) { 76 PortletEntry entry = (PortletEntry)enum.nextElement(); 77 78 if ( (entry.getURL()!= null) && entry.getURL().equals(url) ) 79 { 80 try 81 { 82 PortletRefresher pr = new PortletRefresher( entry ); 83 84 pr.run(); 89 } 91 catch (Throwable t) 92 { 93 logger.info( "DiskCacheDaemon: Error refreshing: " + url ); 95 } 96 } 97 } 98 } 99 } catch ( Throwable t ) { 100 logger.error("Error refreshing URL", t); 101 } 102 } 103 } 104 | Popular Tags |