1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.portal.portlets;
18
19
20 import org.apache.jetspeed.portal.expire.Expire;
21 import org.apache.jetspeed.portal.expire.ExpireFactory;
22 import org.apache.jetspeed.portal.expire.FileWatchExpire;
23 import org.apache.jetspeed.services.logging.JetspeedLogFactoryService;
24 import org.apache.jetspeed.services.logging.JetspeedLogger;
25 import org.apache.jetspeed.util.JetspeedException;
26
27
28 /***
29 Just like AbstractPortlet except that when its URL is modified on disk it
30 automatically expires itself.
31
32 @author <A HREF="mailto:burton@apache.org">Kevin A. Burton</A>
33 @version $Id: FileWatchPortlet.java,v 1.9 2004/02/23 04:03:34 jford Exp $
34 */
35 public abstract class FileWatchPortlet extends AbstractInstancePortlet
36 {
37
38 /***
39 * Static initialization of the logger for this class
40 */
41 private static final JetspeedLogger logger = JetspeedLogFactoryService.getLogger(FileWatchPortlet.class.getName());
42
43 FileWatchExpire expire = null;
44
45 /***
46 Expire this Portlet if it's URL Changes on disk.
47 */
48 public Expire getExpire() {
49
50 try {
51
52 if ( this.expire == null ) {
53
54 this.expire = (FileWatchExpire)ExpireFactory
55 .getExpire( this, ExpireFactory.FILE_WATCH_EXPIRE );
56
57 this.expire.setURL( this.getPortletConfig().getURL() );
58 }
59
60 return this.expire;
61
62 } catch ( JetspeedException e ) {
63 logger.error("Exception", e);
64 return null;
65 }
66
67
68 }
69
70 }
71