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;
2223import org.apache.jetspeed.services.portletcache.Cacheable;
2425// Turbine26import org.apache.turbine.services.cache.CachedObject;
272829/***30<p>31This object is used to wrap a Portlet, ensuring that access control rules are enforced.32</p>3334@author <A HREF="mailto:sgala@apache.org">Santiago Gala</A>35@version $Id: CacheablePortletWrapper.java,v 1.4 2004/02/23 03:27:46 jford Exp $36*/37publicclassCacheablePortletWrapperextendsPortletWrapper implements /*FIXME*/Cacheable38 {
3940/*41 * The cacheable associated with us42 */43privateCacheable wrappedCacheable = null;
444546publicCacheablePortletWrapper( Portlet inner )
47 {
48super( inner );
49if( inner instanceof Cacheable )
50 {
51 wrappedCacheable = (Cacheable) inner;
52 }
53else54 {
55//Log error or throw exception56 }
5758 }
5960//Cacheable interface6162/***63 */64publicboolean isCacheable()
65 {
66return wrappedCacheable.isCacheable();
67 }
6869/***70 */71publicvoid setCacheable(boolean cacheable)
72 {
73 wrappedCacheable.setCacheable( cacheable );
74 }
757677/***78 */79publicExpire getExpire()
80 {
81return wrappedCacheable.getExpire();
82 }
8384/***85 */86publicfinal String getHandle()
87 {
88return wrappedCacheable.getHandle();
89 }
9091/***92 */93publicfinalvoid setHandle( String handle )
94 {
95 wrappedCacheable.setHandle( handle );
96 }
9798/***99 @see Cacheable#getExpirationMillis100 */101public Long getExpirationMillis()
102 {
103return wrappedCacheable.getExpirationMillis();
104 }
105106107/***108 * @see Cacheable#setExpirationMillis109 */110publicvoid setExpirationMillis( long expirationMillis)
111 {
112 wrappedCacheable.setExpirationMillis( expirationMillis );
113 }
114115/***116 * This allows the associated CachedObject to be117 * known. One use of the <CODE>cachedObject</CODE> is to118 * set the expiration time119 *120 * @param cachedObject Handle to the CachedObject121 */122publicvoid setCachedObject(CachedObject cachedObject)
123 {
124 wrappedCacheable.setCachedObject( cachedObject );
125 }
126127 }