1/*2 * Copyright 2000-2004 The Apache Software Foundation.3 * 4 * Licensed under the Apache License, Version 2.0 (the "License");5 * you may not use this file except in compliance with the License.6 * You may obtain a copy of the License at7 * 8 * http://www.apache.org/licenses/LICENSE-2.09 * 10 * Unless required by applicable law or agreed to in writing, software11 * distributed under the License is distributed on an "AS IS" BASIS,12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13 * See the License for the specific language governing permissions and14 * limitations under the License.15 */1617packageorg.apache.jetspeed.portal.portlets;
1819//jetspeed20import org.apache.jetspeed.portal.expire.Expire;
21import org.apache.jetspeed.portal.expire.ExpireFactory;
22import org.apache.jetspeed.portal.expire.FileWatchExpire;
23import org.apache.jetspeed.services.logging.JetspeedLogFactoryService;
24import org.apache.jetspeed.services.logging.JetspeedLogger;
25import org.apache.jetspeed.util.JetspeedException;
262728/***29Just like AbstractPortlet except that when its URL is modified on disk it 30automatically expires itself.3132@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*/35publicabstractclassFileWatchPortletextendsAbstractInstancePortlet36 {
3738/***39 * Static initialization of the logger for this class40 */41privatestaticfinalJetspeedLogger logger = JetspeedLogFactoryService.getLogger(FileWatchPortlet.class.getName());
4243FileWatchExpire expire = null;
4445/***46 Expire this Portlet if it's URL Changes on disk.47 */48publicExpire getExpire() {
4950try {
5152if ( this.expire == null ) {
5354this.expire = (FileWatchExpire)ExpireFactory
55 .getExpire( this, ExpireFactory.FILE_WATCH_EXPIRE );
5657this.expire.setURL( this.getPortletConfig().getURL() );
58 }
5960returnthis.expire;
6162 } catch ( JetspeedException e ) {
63 logger.error("Exception", e);
64returnnull;
65 }
666768 }
6970 }
71