1 16 17 package org.apache.jetspeed.portal.expire; 18 19 import org.apache.jetspeed.portal.Portlet; 21 import org.apache.jetspeed.services.logging.JetspeedLogFactoryService; 22 import org.apache.jetspeed.services.logging.JetspeedLogger; 23 import org.apache.jetspeed.util.JetspeedException; 24 25 31 public class ExpireFactory 32 { 33 34 37 private static final JetspeedLogger logger = JetspeedLogFactoryService.getLogger(ExpireFactory.class.getName()); 38 39 public static final String FILE_WATCH_EXPIRE 40 = "org.apache.jetspeed.portal.expire.FileWatchExpire"; 41 42 public static final String NO_EXPIRE 43 = "org.apache.jetspeed.portal.expire.NoExpire"; 44 45 46 50 public static Expire noExpire = new NoExpire(); 51 52 53 59 public static Expire getExpire( Portlet portlet, 60 String classname ) throws JetspeedException { 61 62 if ( classname.equals( NO_EXPIRE ) ) { 63 return noExpire; 64 } 65 66 try { 67 Expire expire = (Expire)Class.forName( classname ).newInstance(); 68 expire.init(); 69 expire.setPortlet( portlet ); 70 expire.setExpired( false ); 71 72 return expire; 73 } catch ( Throwable t ) { 74 logger.error("Throwable", t ); 75 throw new JetspeedException( t.getMessage() ); 76 } 77 } 78 79 } 80 81 | Popular Tags |