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            public static final String PORTAL_CACHE_MANAGER_NAME =
031                    "portal.cache.manager.name";
032    
033            public static final String PORTAL_CACHE_MANAGER_TYPE =
034                    "portal.cache.manager.type";
035    
036            @Proxy
037            public void clearAll() throws PortalCacheException;
038    
039            public void destroy();
040    
041            public PortalCache<K, V> getCache(String portalCacheName)
042                    throws PortalCacheException;
043    
044            public PortalCache<K, V> getCache(String portalCacheName, boolean blocking)
045                    throws PortalCacheException;
046    
047            public Set<CacheManagerListener> getCacheManagerListeners();
048    
049            public String getName();
050    
051            public boolean isClusterAware();
052    
053            @Proxy
054            public void reconfigureCaches(URL configurationURL);
055    
056            public boolean registerCacheManagerListener(
057                    CacheManagerListener cacheManagerListener);
058    
059            public void removeCache(String portalCacheName);
060    
061            public boolean unregisterCacheManagerListener(
062                    CacheManagerListener cacheManagerListener);
063    
064            public void unregisterCacheManagerListeners();
065    
066    }