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> getPortalCache(String portalCacheName)
042                    throws PortalCacheException;
043    
044            public PortalCache<K, V> getPortalCache(
045                            String portalCacheName, boolean blocking)
046                    throws PortalCacheException;
047    
048            public Set<PortalCacheManagerListener> getPortalCacheManagerListeners();
049    
050            public String getPortalCacheManagerName();
051    
052            public boolean isClusterAware();
053    
054            @Proxy
055            public void reconfigurePortalCaches(URL configurationURL);
056    
057            public boolean registerPortalCacheManagerListener(
058                    PortalCacheManagerListener portalCacheManagerListener);
059    
060            public void removePortalCache(String portalCacheName);
061    
062            public boolean unregisterPortalCacheManagerListener(
063                    PortalCacheManagerListener portalCacheManagerListener);
064    
065            public void unregisterPortalCacheManagerListeners();
066    
067    }