001    /**
002     * Copyright (c) 2000-2010 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 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            public static Object get(String name, String key) {
034                    return getSingleVMPool().get(name, key);
035            }
036    
037            /**
038             * @deprecated
039             */
040            public static Object get(PortalCache portalCache, String key) {
041                    return getSingleVMPool().get(portalCache, 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            public static void put(String name, String key, Object obj) {
057                    getSingleVMPool().put(name, key, obj);
058            }
059    
060            /**
061             * @deprecated
062             */
063            public static void put(PortalCache portalCache, String key, Object obj) {
064                    getSingleVMPool().put(portalCache, key, obj);
065            }
066    
067            /**
068             * @deprecated
069             */
070            public static void put(
071                    PortalCache portalCache, String key, Object obj, int timeToLive) {
072    
073                    getSingleVMPool().put(portalCache, key, obj, timeToLive);
074            }
075    
076            public static void put(String name, String key, Serializable obj) {
077                    getSingleVMPool().put(name, key, obj);
078            }
079    
080            /**
081             * @deprecated
082             */
083            public static void put(
084                    PortalCache portalCache, String key, Serializable obj) {
085    
086                    getSingleVMPool().put(portalCache, key, obj);
087            }
088    
089            /**
090             * @deprecated
091             */
092            public static void put(
093                    PortalCache portalCache, String key, Serializable obj, int timeToLive) {
094    
095                    getSingleVMPool().put(portalCache, key, obj, timeToLive);
096            }
097    
098            public static void remove(String name, String key) {
099                    getSingleVMPool().remove(name, key);
100            }
101    
102            /**
103             * @deprecated
104             */
105            public static void remove(PortalCache portalCache, String key) {
106                    getSingleVMPool().remove(portalCache, key);
107            }
108    
109            public static void removeCache(String name) {
110                    getSingleVMPool().removeCache(name);
111            }
112    
113            public void setSingleVMPool(SingleVMPool singleVMPool) {
114                    _singleVMPool = singleVMPool;
115            }
116    
117            private static SingleVMPool _singleVMPool;
118    
119    }