001
014
015 package com.liferay.portal.kernel.cache;
016
017 import com.liferay.portal.kernel.nio.intraband.proxy.annotation.Id;
018 import com.liferay.portal.kernel.nio.intraband.proxy.annotation.Proxy;
019
020 import java.io.Serializable;
021
022 import java.util.List;
023
024
029 public interface PortalCache<K extends Serializable, V> {
030
031 public static final int DEFAULT_TIME_TO_LIVE = 0;
032
033 @Proxy
034 public V get(K key);
035
036 @Proxy
037 public List<K> getKeys();
038
039 @Id
040 public String getName();
041
042 public PortalCacheManager<K, V> getPortalCacheManager();
043
044 @Proxy
045 public void put(K key, V value);
046
047 @Proxy
048 public void put(K key, V value, int timeToLive);
049
050 @Proxy
051 public void putQuiet(K key, V value);
052
053 @Proxy
054 public void putQuiet(K key, V value, int timeToLive);
055
056 public void registerCacheListener(CacheListener<K, V> cacheListener);
057
058 public void registerCacheListener(
059 CacheListener<K, V> cacheListener,
060 CacheListenerScope cacheListenerScope);
061
062 @Proxy
063 public void remove(K key);
064
065 @Proxy
066 public void removeAll();
067
068 public void unregisterCacheListener(CacheListener<K, V> cacheListener);
069
070 public void unregisterCacheListeners();
071
072 }