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