001
014
015 package com.liferay.portal.cache;
016
017 import com.liferay.portal.kernel.cache.MultiVMPool;
018 import com.liferay.portal.kernel.cache.PortalCache;
019 import com.liferay.portal.kernel.cache.PortalCacheManager;
020
021 import java.io.Serializable;
022
023
027 public class MultiVMPoolImpl implements MultiVMPool {
028
029 public void clear() {
030 _portalCacheManager.clearAll();
031 }
032
033 public void clear(String name) {
034 PortalCache portalCache = getCache(name);
035
036 portalCache.removeAll();
037 }
038
039
042 public Object get(PortalCache portalCache, String key) {
043 return portalCache.get(key);
044 }
045
046 public Object get(String name, String key) {
047 PortalCache portalCache = getCache(name);
048
049 return portalCache.get(key);
050 }
051
052 public PortalCache getCache(String name) {
053 return _portalCacheManager.getCache(name);
054 }
055
056 public PortalCache getCache(String name, boolean blocking) {
057 return _portalCacheManager.getCache(name, blocking);
058 }
059
060
063 public void put(PortalCache portalCache, String key, Object value) {
064 portalCache.put(key, value);
065 }
066
067
070 public void put(PortalCache portalCache, String key, Serializable value) {
071 portalCache.put(key, value);
072 }
073
074 public void put(String name, String key, Object value) {
075 PortalCache portalCache = getCache(name);
076
077 portalCache.put(key, value);
078 }
079
080 public void put(String name, String key, Serializable value) {
081 PortalCache portalCache = getCache(name);
082
083 portalCache.put(key, value);
084 }
085
086
089 public void remove(PortalCache portalCache, String key) {
090 portalCache.remove(key);
091 }
092
093 public void remove(String name, String key) {
094 PortalCache portalCache = getCache(name);
095
096 portalCache.remove(key);
097 }
098
099 public void removeCache(String name) {
100 _portalCacheManager.removeCache(name);
101 }
102
103 public void setPortalCacheManager(PortalCacheManager portalCacheManager) {
104 _portalCacheManager = portalCacheManager;
105 }
106
107 private PortalCacheManager _portalCacheManager;
108
109 }