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.kernel.cache;
016    
017    import com.liferay.portal.kernel.nio.intraband.proxy.annotation.Proxy;
018    
019    import java.io.Serializable;
020    
021    import java.net.URL;
022    
023    import java.util.Set;
024    
025    /**
026     * @author Joseph Shum
027     */
028    public interface PortalCacheManager<K extends Serializable, V> {
029    
030            @Proxy
031            public void clearAll() throws PortalCacheException;
032    
033            public void destroy();
034    
035            public PortalCache<K, V> getCache(String name) throws PortalCacheException;
036    
037            public PortalCache<K, V> getCache(String name, boolean blocking)
038                    throws PortalCacheException;
039    
040            public Set<CacheManagerListener> getCacheManagerListeners();
041    
042            public String getName();
043    
044            public boolean isClusterAware();
045    
046            @Proxy
047            public void reconfigureCaches(URL configurationURL);
048    
049            public boolean registerCacheManagerListener(
050                    CacheManagerListener cacheManagerListener);
051    
052            public void removeCache(String name);
053    
054            public boolean unregisterCacheManagerListener(
055                    CacheManagerListener cacheManagerListener);
056    
057            public void unregisterCacheManagerListeners();
058    
059    }