001    /**
002     * Copyright (c) 2000-present 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.test;
016    
017    import com.liferay.portal.kernel.cache.CacheManagerListener;
018    import com.liferay.portal.kernel.cache.PortalCache;
019    import com.liferay.portal.kernel.cache.PortalCacheManager;
020    
021    import java.io.Serializable;
022    
023    import java.net.URL;
024    
025    import java.util.Set;
026    
027    /**
028     * @author Tina Tian
029     */
030    public class MockPortalCacheManager<K extends Serializable, V>
031            implements PortalCacheManager<K, V> {
032    
033            public MockPortalCacheManager(String portalCacheManagerName) {
034                    _portalCacheManagerName = portalCacheManagerName;
035            }
036    
037            @Override
038            public void clearAll() {
039                    throw new UnsupportedOperationException();
040            }
041    
042            @Override
043            public void destroy() {
044                    throw new UnsupportedOperationException();
045            }
046    
047            @Override
048            public PortalCache<K, V> getCache(String portalCacheName) {
049                    throw new UnsupportedOperationException();
050            }
051    
052            @Override
053            public PortalCache<K, V> getCache(
054                    String portalCacheName, boolean blocking) {
055    
056                    throw new UnsupportedOperationException();
057            }
058    
059            @Override
060            public Set<CacheManagerListener> getCacheManagerListeners() {
061                    throw new UnsupportedOperationException();
062            }
063    
064            @Override
065            public String getName() {
066                    return _portalCacheManagerName;
067            }
068    
069            @Override
070            public boolean isClusterAware() {
071                    throw new UnsupportedOperationException();
072            }
073    
074            @Override
075            public void reconfigureCaches(URL configurationURL) {
076                    throw new UnsupportedOperationException();
077            }
078    
079            @Override
080            public boolean registerCacheManagerListener(
081                    CacheManagerListener cacheManagerListener) {
082    
083                    throw new UnsupportedOperationException();
084            }
085    
086            @Override
087            public void removeCache(String portalCacheName) {
088                    throw new UnsupportedOperationException();
089            }
090    
091            @Override
092            public boolean unregisterCacheManagerListener(
093                    CacheManagerListener cacheManagerListener) {
094    
095                    throw new UnsupportedOperationException();
096            }
097    
098            @Override
099            public void unregisterCacheManagerListeners() {
100                    throw new UnsupportedOperationException();
101            }
102    
103            private final String _portalCacheManagerName;
104    
105    }