1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.portal.security.portlets;
18
19
20 import org.apache.jetspeed.portal.Portlet;
21 import org.apache.jetspeed.portal.expire.Expire;
22
23 import org.apache.jetspeed.services.portletcache.Cacheable;
24
25
26 import org.apache.turbine.services.cache.CachedObject;
27
28
29 /***
30 <p>
31 This object is used to wrap a Portlet, ensuring that access control rules are enforced.
32 </p>
33
34 @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 */
37 public class CacheablePortletWrapper extends PortletWrapper implements
38 {
39
40
41
42
43 private Cacheable wrappedCacheable = null;
44
45
46 public CacheablePortletWrapper( Portlet inner )
47 {
48 super( inner );
49 if( inner instanceof Cacheable )
50 {
51 wrappedCacheable = (Cacheable) inner;
52 }
53 else
54 {
55
56 }
57
58 }
59
60
61
62 /***
63 */
64 public boolean isCacheable()
65 {
66 return wrappedCacheable.isCacheable();
67 }
68
69 /***
70 */
71 public void setCacheable(boolean cacheable)
72 {
73 wrappedCacheable.setCacheable( cacheable );
74 }
75
76
77 /***
78 */
79 public Expire getExpire()
80 {
81 return wrappedCacheable.getExpire();
82 }
83
84 /***
85 */
86 public final String getHandle()
87 {
88 return wrappedCacheable.getHandle();
89 }
90
91 /***
92 */
93 public final void setHandle( String handle )
94 {
95 wrappedCacheable.setHandle( handle );
96 }
97
98 /***
99 @see Cacheable#getExpirationMillis
100 */
101 public Long getExpirationMillis()
102 {
103 return wrappedCacheable.getExpirationMillis();
104 }
105
106
107 /***
108 * @see Cacheable#setExpirationMillis
109 */
110 public void setExpirationMillis( long expirationMillis)
111 {
112 wrappedCacheable.setExpirationMillis( expirationMillis );
113 }
114
115 /***
116 * This allows the associated CachedObject to be
117 * known. One use of the <CODE>cachedObject</CODE> is to
118 * set the expiration time
119 *
120 * @param cachedObject Handle to the CachedObject
121 */
122 public void setCachedObject(CachedObject cachedObject)
123 {
124 wrappedCacheable.setCachedObject( cachedObject );
125 }
126
127 }