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.PortletFactory; 25 import org.apache.jetspeed.services.urlmanager.URLManager; 26 27 import org.apache.jetspeed.services.resources.JetspeedResources; 29 30 39 public class PortletRefresher implements Runnable { 40 41 private PortletEntry entry = null; 42 43 46 private static final JetspeedLogger logger = JetspeedLogFactoryService.getLogger(PortletRefresher.class.getName()); 47 48 51 public PortletRefresher( PortletEntry entry ) { 52 this.entry = entry; 53 } 54 55 57 public void run() { 58 59 60 try { 61 if ( JetspeedResources.getBoolean( JetspeedResources.AUTOCREATE_PORTLETS_KEY ) ) { 62 63 PortletFactory.getPortlet( this.entry.getName(), "0" ); 64 65 } 66 67 } catch ( Throwable t ) { 68 logger.error("Error getting portlet", t); 69 70 URLManager.register( this.entry.getURL(), URLManager.STATUS_BAD, t.toString() ); 71 Registry.removeEntry( Registry.PORTLET, this.entry.getName() ); 72 73 } 74 75 } 76 77 } 78 79 | Popular Tags |