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