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 public Object get(String name, String key) {
040 PortalCache portalCache = getCache(name);
041
042 return portalCache.get(key);
043 }
044
045
048 public Object get(PortalCache portalCache, String key) {
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 public void put(String name, String key, Object obj) {
061 PortalCache portalCache = getCache(name);
062
063 portalCache.put(key, obj);
064 }
065
066
069 public void put(PortalCache portalCache, String key, Object obj) {
070 portalCache.put(key, obj);
071 }
072
073 public void put(String name, String key, Serializable obj) {
074 PortalCache portalCache = getCache(name);
075
076 portalCache.put(key, obj);
077 }
078
079
082 public void put(PortalCache portalCache, String key, Serializable obj) {
083 portalCache.put(key, obj);
084 }
085
086 public void remove(String name, String key) {
087 PortalCache portalCache = getCache(name);
088
089 portalCache.remove(key);
090 }
091
092
095 public void remove(PortalCache portalCache, String key) {
096 portalCache.remove(key);
097 }
098
099 public void setPortalCacheManager(PortalCacheManager portalCacheManager) {
100 _portalCacheManager = portalCacheManager;
101 }
102
103 private PortalCacheManager _portalCacheManager;
104
105 }