1
19
20 package com.liferay.portal.cache;
21
22 import com.liferay.portal.kernel.cache.MultiVMPool;
23 import com.liferay.portal.kernel.cache.PortalCache;
24 import com.liferay.portal.kernel.cache.PortalCacheManager;
25
26 import java.io.Serializable;
27
28
35 public class MultiVMPoolImpl implements MultiVMPool {
36
37 public void clear() {
38 _portalCacheManager.clearAll();
39 }
40
41 public void clear(String name) {
42 PortalCache portalCache = getCache(name);
43
44 portalCache.removeAll();
45 }
46
47 public Object get(String name, String key) {
48 PortalCache portalCache = getCache(name);
49
50 return get(portalCache, key);
51 }
52
53 public Object get(PortalCache portalCache, String key) {
54 return portalCache.get(key);
55 }
56
57 public PortalCache getCache(String name) {
58 return _portalCacheManager.getCache(name);
59 }
60
61 public PortalCache getCache(String name, boolean blocking) {
62 return _portalCacheManager.getCache(name, blocking);
63 }
64
65 public void put(String name, String key, Object obj) {
66 PortalCache portalCache = getCache(name);
67
68 put(portalCache, key, obj);
69 }
70
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 put(portalCache, key, obj);
79 }
80
81 public void put(PortalCache portalCache, String key, Serializable obj) {
82 portalCache.put(key, obj);
83 }
84
85 public void remove(String name, String key) {
86 PortalCache portalCache = getCache(name);
87
88 remove(portalCache, key);
89 }
90
91 public void remove(PortalCache portalCache, String key) {
92 portalCache.remove(key);
93 }
94
95 public void setPortalCacheManager(PortalCacheManager portalCacheManager) {
96 _portalCacheManager = portalCacheManager;
97 }
98
99 private PortalCacheManager _portalCacheManager;
100
101 }