001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.kernel.cache;
016    
017    import java.io.Serializable;
018    
019    /**
020     * @author Brian Wing Shun Chan
021     * @author Michael Young
022     */
023    public class MultiVMPoolUtil {
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            /**
034             * @deprecated
035             */
036            public static Object get(PortalCache portalCache, String key) {
037                    return getMultiVMPool().get(portalCache, key);
038            }
039    
040            public static Object get(String name, String key) {
041                    return getMultiVMPool().get(name, key);
042            }
043    
044            public static PortalCache getCache(String name) {
045                    return getMultiVMPool().getCache(name);
046            }
047    
048            public static PortalCache getCache(String name, boolean blocking) {
049                    return getMultiVMPool().getCache(name, blocking);
050            }
051    
052            public static MultiVMPool getMultiVMPool() {
053                    return _multiVMPool;
054            }
055    
056            /**
057             * @deprecated
058             */
059            public static void put(PortalCache portalCache, String key, Object value) {
060                    getMultiVMPool().put(portalCache, key, value);
061            }
062    
063            /**
064             * @deprecated
065             */
066            public static void put(
067                    PortalCache portalCache, String key, Serializable value) {
068    
069                    getMultiVMPool().put(portalCache, key, value);
070            }
071    
072            public static void put(String name, String key, Object value) {
073                    getMultiVMPool().put(name, key, value);
074            }
075    
076            public static void put(String name, String key, Serializable value) {
077                    getMultiVMPool().put(name, key, value);
078            }
079    
080            /**
081             * @deprecated
082             */
083            public static void remove(PortalCache portalCache, String key) {
084                    getMultiVMPool().remove(portalCache, key);
085            }
086    
087            public static void remove(String name, String key) {
088                    getMultiVMPool().remove(name, key);
089            }
090    
091            public static void removeCache(String name) {
092                    getMultiVMPool().removeCache(name);
093            }
094    
095            public void setMultiVMPool(MultiVMPool multiVMPool) {
096                    _multiVMPool = multiVMPool;
097            }
098    
099            private static MultiVMPool _multiVMPool;
100    
101    }