1/*2 * Copyright 2000-2001,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.security.portlets;
1819//jetspeed20import org.apache.jetspeed.portal.Portlet;
21import org.apache.jetspeed.portal.expire.Expire;
22import org.apache.jetspeed.services.portletcache.Cacheable;
2324import org.apache.turbine.services.cache.CachedObject;
252627/***28<p>29This object is used to wrap a Portlet, ensuring that access control rules are enforced.30</p>3132@author <A HREF="mailto:sgala@apache.org">Santiago Gala</A>33@version $Id: CacheableStatefulPortletWrapper.java,v 1.4 2004/02/23 03:27:46 jford Exp $34*/35publicclassCacheableStatefulPortletWrapperextendsStatefulPortletWrapper implements /*FIXME*/Cacheable36 {
3738/*39 * The cacheable associated with us40 */41privateCacheable wrappedCacheable = null;
424344publicCacheableStatefulPortletWrapper( Portlet inner )
45 {
46super( inner );
47if( inner instanceof Cacheable )
48 {
49 wrappedCacheable = (Cacheable) inner;
50 }
51else52 {
53//Log error or throw exception54 }
5556 }
5758//Cacheable interface5960/***61 */62publicboolean isCacheable()
63 {
64return wrappedCacheable.isCacheable();
65 }
6667/***68 */69publicvoid setCacheable(boolean cacheable)
70 {
71 wrappedCacheable.setCacheable( cacheable );
72 }
737475/***76 */77publicExpire getExpire()
78 {
79return wrappedCacheable.getExpire();
80 }
8182/***83 */84publicfinal String getHandle()
85 {
86return wrappedCacheable.getHandle();
87 }
8889/***90 */91publicfinalvoid setHandle( String handle )
92 {
93 wrappedCacheable.setHandle( handle );
94 }
9596/***97 @see Cacheable#getExpirationMillis98 */99public Long getExpirationMillis()
100 {
101return wrappedCacheable.getExpirationMillis();
102 }
103104105/***106 @see Cacheable#setExpirationMillis107 */108publicvoid setExpirationMillis( long expirationMillis)
109 {
110 wrappedCacheable.setExpirationMillis( expirationMillis );
111 }
112113/***114 * This allows the associated CachedObject to be115 * known. One use of the <CODE>cachedObject</CODE> is to116 * set the expiration time117 *118 * @param cachedObject Handle to the CachedObject119 */120publicvoid setCachedObject(CachedObject cachedObject)
121 {
122 wrappedCacheable.setCachedObject( cachedObject );
123 }
124125 }