001
014
015 package com.liferay.portal.cache;
016
017 import com.liferay.portal.kernel.cache.PortalCache;
018 import com.liferay.portal.kernel.cache.PortalCacheManager;
019 import com.liferay.portal.kernel.cache.SingleVMPool;
020 import com.liferay.portal.kernel.security.pacl.DoPrivileged;
021
022 import java.io.Serializable;
023
024
028 @DoPrivileged
029 public class SingleVMPoolImpl implements SingleVMPool {
030
031 @Override
032 public void clear() {
033 _portalCacheManager.clearAll();
034 }
035
036 @Override
037 public void clear(String name) {
038 PortalCache portalCache = getCache(name);
039
040 portalCache.removeAll();
041 }
042
043
046 @Override
047 public Object get(PortalCache portalCache, String key) {
048 return portalCache.get(key);
049 }
050
051 @Override
052 public Object get(String name, String key) {
053 PortalCache portalCache = getCache(name);
054
055 return portalCache.get(key);
056 }
057
058 @Override
059 public PortalCache getCache(String name) {
060 return _portalCacheManager.getCache(name);
061 }
062
063 @Override
064 public PortalCache getCache(String name, boolean blocking) {
065 return _portalCacheManager.getCache(name, blocking);
066 }
067
068
071 @Override
072 public void put(PortalCache portalCache, String key, Object value) {
073 portalCache.put(key, value);
074 }
075
076
079 @Override
080 public void put(
081 PortalCache portalCache, String key, Object value, int timeToLive) {
082
083 portalCache.put(key, value, timeToLive);
084 }
085
086
089 @Override
090 public void put(PortalCache portalCache, String key, Serializable value) {
091 portalCache.put(key, value);
092 }
093
094
097 @Override
098 public void put(
099 PortalCache portalCache, String key, Serializable value,
100 int timeToLive) {
101
102 portalCache.put(key, value, timeToLive);
103 }
104
105 @Override
106 public void put(String name, String key, Object value) {
107 PortalCache portalCache = getCache(name);
108
109 portalCache.put(key, value);
110 }
111
112 @Override
113 public void put(String name, String key, Serializable value) {
114 PortalCache portalCache = getCache(name);
115
116 portalCache.put(key, value);
117 }
118
119
122 @Override
123 public void remove(PortalCache portalCache, String key) {
124 portalCache.remove(key);
125 }
126
127 @Override
128 public void remove(String name, String key) {
129 PortalCache portalCache = getCache(name);
130
131 portalCache.remove(key);
132 }
133
134 @Override
135 public void removeCache(String name) {
136 _portalCacheManager.removeCache(name);
137 }
138
139 public void setPortalCacheManager(PortalCacheManager portalCacheManager) {
140 _portalCacheManager = portalCacheManager;
141 }
142
143 private PortalCacheManager _portalCacheManager;
144
145 }