1
14
15 package com.liferay.portal.cache;
16
17 import com.liferay.portal.kernel.cache.MultiVMPool;
18 import com.liferay.portal.kernel.cache.PortalCache;
19 import com.liferay.portal.kernel.cache.PortalCacheManager;
20
21 import java.io.Serializable;
22
23
29 public class MultiVMPoolImpl implements MultiVMPool {
30
31 public void clear() {
32 _portalCacheManager.clearAll();
33 }
34
35 public void clear(String name) {
36 PortalCache portalCache = getCache(name);
37
38 portalCache.removeAll();
39 }
40
41 public Object get(String name, String key) {
42 PortalCache portalCache = getCache(name);
43
44 return portalCache.get(key);
45 }
46
47
50 public Object get(PortalCache portalCache, String key) {
51 return portalCache.get(key);
52 }
53
54 public PortalCache getCache(String name) {
55 return _portalCacheManager.getCache(name);
56 }
57
58 public PortalCache getCache(String name, boolean blocking) {
59 return _portalCacheManager.getCache(name, blocking);
60 }
61
62 public void put(String name, String key, Object obj) {
63 PortalCache portalCache = getCache(name);
64
65 portalCache.put(key, obj);
66 }
67
68
71 public void put(PortalCache portalCache, String key, Object obj) {
72 portalCache.put(key, obj);
73 }
74
75 public void put(String name, String key, Serializable obj) {
76 PortalCache portalCache = getCache(name);
77
78 portalCache.put(key, obj);
79 }
80
81
84 public void put(PortalCache portalCache, String key, Serializable obj) {
85 portalCache.put(key, obj);
86 }
87
88 public void remove(String name, String key) {
89 PortalCache portalCache = getCache(name);
90
91 portalCache.remove(key);
92 }
93
94
97 public void remove(PortalCache portalCache, String key) {
98 portalCache.remove(key);
99 }
100
101 public void setPortalCacheManager(PortalCacheManager portalCacheManager) {
102 _portalCacheManager = portalCacheManager;
103 }
104
105 private PortalCacheManager _portalCacheManager;
106
107 }