1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.services.portletcache;
18
19 import org.apache.turbine.services.TurbineServices;
20
21 /***
22 * This class is a static accessor for the PortletCache service
23 *
24 * @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>
25 * @author <a href="mailto:raphael@apache.org">Raphaël Luta</a>
26 * @version $Id: PortletCache.java,v 1.4 2004/02/23 03:34:54 jford Exp $
27 */
28 public class PortletCache {
29
30 /***
31 * Add an object to the cache
32 *
33 * @see PortletCacheService#addCacheable
34 */
35 public static void addCacheable( Cacheable item ) {
36
37 PortletCacheService gcs = (PortletCacheService)TurbineServices
38 .getInstance()
39 .getService( PortletCacheService.SERVICE_NAME );
40
41 gcs.addCacheable( item );
42 }
43
44 /***
45 * Removes an object from the cache based on its handle
46 *
47 * @see PortletCacheService#removeCacheable
48 */
49 public static void removeCacheable( String handle ) {
50
51 PortletCacheService gcs = (PortletCacheService)TurbineServices
52 .getInstance()
53 .getService( PortletCacheService.SERVICE_NAME );
54
55 gcs.removeCacheable( handle );
56
57 }
58
59 /***
60 * Retrieves an object from the cache
61 *
62 * @see PortletCacheService#getCacheable
63 */
64 public static Cacheable getCacheable( String handle ) {
65
66 PortletCacheService gcs = (PortletCacheService)TurbineServices
67 .getInstance()
68 .getService( PortletCacheService.SERVICE_NAME );
69
70 return gcs.getCacheable( handle );
71 }
72
73 }