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 Brian Wing Shun Chan
021     * @author Michael Young
022     */
023    public class SingleVMPoolUtil {
024    
025            public static void clear() {
026                    getSingleVMPool().clear();
027            }
028    
029            public static void clear(String name) {
030                    getSingleVMPool().clear(name);
031            }
032    
033            /**
034             * @deprecated
035             */
036            public static Object get(PortalCache portalCache, String key) {
037                    return getSingleVMPool().get(portalCache, key);
038            }
039    
040            public static Object get(String name, String key) {
041                    return getSingleVMPool().get(name, key);
042            }
043    
044            public static PortalCache getCache(String name) {
045                    return getSingleVMPool().getCache(name);
046            }
047    
048            public static PortalCache getCache(String name, boolean blocking) {
049                    return getSingleVMPool().getCache(name, blocking);
050            }
051    
052            public static SingleVMPool getSingleVMPool() {
053                    return _singleVMPool;
054            }
055    
056            /**
057             * @deprecated
058             */
059            public static void put(PortalCache portalCache, String key, Object value) {
060                    getSingleVMPool().put(portalCache, key, value);
061            }
062    
063            /**
064             * @deprecated
065             */
066            public static void put(
067                    PortalCache portalCache, String key, Object value, int timeToLive) {
068    
069                    getSingleVMPool().put(portalCache, key, value, timeToLive);
070            }
071    
072            /**
073             * @deprecated
074             */
075            public static void put(
076                    PortalCache portalCache, String key, Serializable value) {
077    
078                    getSingleVMPool().put(portalCache, key, value);
079            }
080    
081            /**
082             * @deprecated
083             */
084            public static void put(
085                    PortalCache portalCache, String key, Serializable value,
086                    int timeToLive) {
087    
088                    getSingleVMPool().put(portalCache, key, value, timeToLive);
089            }
090    
091            public static void put(String name, String key, Object value) {
092                    getSingleVMPool().put(name, key, value);
093            }
094    
095            public static void put(String name, String key, Serializable value) {
096                    getSingleVMPool().put(name, key, value);
097            }
098    
099            /**
100             * @deprecated
101             */
102            public static void remove(PortalCache portalCache, String key) {
103                    getSingleVMPool().remove(portalCache, key);
104            }
105    
106            public static void remove(String name, String key) {
107                    getSingleVMPool().remove(name, key);
108            }
109    
110            public static void removeCache(String name) {
111                    getSingleVMPool().removeCache(name);
112            }
113    
114            public void setSingleVMPool(SingleVMPool singleVMPool) {
115                    _singleVMPool = singleVMPool;
116            }
117    
118            private static SingleVMPool _singleVMPool;
119    
120    }