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.cache;
016    
017    import com.liferay.portal.kernel.cache.MultiVMPool;
018    import com.liferay.portal.kernel.cache.PortalCache;
019    import com.liferay.portal.kernel.cache.PortalCacheManager;
020    
021    import java.io.Serializable;
022    
023    /**
024     * @author Brian Wing Shun Chan
025     * @author Michael Young
026     */
027    public class MultiVMPoolImpl implements MultiVMPool {
028    
029            public void clear() {
030                    _portalCacheManager.clearAll();
031            }
032    
033            public PortalCache<? extends Serializable, ? extends Serializable> getCache(
034                    String name) {
035    
036                    return _portalCacheManager.getCache(name);
037            }
038    
039            public PortalCache<? extends Serializable, ? extends Serializable> getCache(
040                    String name, boolean blocking) {
041    
042                    return _portalCacheManager.getCache(name, blocking);
043            }
044    
045            public void removeCache(String name) {
046                    _portalCacheManager.removeCache(name);
047            }
048    
049            public void setPortalCacheManager(
050                    PortalCacheManager<? extends Serializable, ? extends Serializable>
051                            portalCacheManager) {
052    
053                    _portalCacheManager = portalCacheManager;
054            }
055    
056            private PortalCacheManager<? extends Serializable, ? extends Serializable>
057                    _portalCacheManager;
058    
059    }