001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.cache;
016    
017    import java.io.Serializable;
018    
019    /**
020     * @author Edward Han
021     * @author Brian Wing Shun Chan
022     */
023    public class MultiVMKeyPoolUtil {
024    
025            public static void clear() {
026                    getMultiVMPool().clear();
027            }
028    
029            public static void clear(String name) {
030                    getMultiVMPool().clear(name);
031            }
032    
033            public static Object get(String name, String key) {
034                    return getMultiVMPool().get(name, key);
035            }
036    
037            public static PortalCache getCache(String name) {
038                    return getMultiVMPool().getCache(name);
039            }
040    
041            public static PortalCache getCache(String name, boolean blocking) {
042                    return getMultiVMPool().getCache(name, blocking);
043            }
044    
045            public static MultiVMPool getMultiVMPool() {
046                    return _multiVMPool;
047            }
048    
049            public static void put(String name, String key, Object value) {
050                    getMultiVMPool().put(name, key, value);
051            }
052    
053            public static void put(String name, String key, Serializable value) {
054                    getMultiVMPool().put(name, key, value);
055            }
056    
057            public static void remove(String name, String key) {
058                    getMultiVMPool().remove(name, key);
059            }
060    
061            public static void removeCache(String name) {
062                    getMultiVMPool().removeCache(name);
063            }
064    
065            public void setMultiVMPool(MultiVMPool multiVMPool) {
066                    _multiVMPool = multiVMPool;
067            }
068    
069            private static MultiVMPool _multiVMPool;
070    
071    }