001
014
015 package com.liferay.portal.kernel.cache;
016
017 import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
018 import com.liferay.portal.kernel.spring.osgi.OSGiBeanProperties;
019
020 import java.io.Serializable;
021
022
026 @OSGiBeanProperties(service = SingleVMPoolUtil.class)
027 public class SingleVMPoolUtil {
028
029 public static void clear() {
030 getSingleVMPool().clear();
031 }
032
033 public static <K extends Serializable, V> PortalCache<K, V> getCache(
034 String portalCacheName) {
035
036 return (PortalCache<K, V>)getSingleVMPool().getCache(portalCacheName);
037 }
038
039 public static <K extends Serializable, V> PortalCache<K, V> getCache(
040 String portalCacheName, boolean blocking) {
041
042 return (PortalCache<K, V>)getSingleVMPool().getCache(
043 portalCacheName, blocking);
044 }
045
046 public static <K extends Serializable, V> PortalCacheManager<K, V>
047 getCacheManager() {
048
049 return (PortalCacheManager<K, V>)getSingleVMPool().getCacheManager();
050 }
051
052 public static SingleVMPool getSingleVMPool() {
053 PortalRuntimePermission.checkGetBeanProperty(SingleVMPoolUtil.class);
054
055 return _singleVMPool;
056 }
057
058 public static void removeCache(String portalCacheName) {
059 getSingleVMPool().removeCache(portalCacheName);
060 }
061
062 public void setSingleVMPool(SingleVMPool singleVMPool) {
063 PortalRuntimePermission.checkSetBeanProperty(getClass());
064
065 _singleVMPool = singleVMPool;
066 }
067
068 private static SingleVMPool _singleVMPool;
069
070 }