001
014
015 package com.liferay.portal.cache.keypool;
016
017 import com.liferay.portal.kernel.cache.CacheListener;
018 import com.liferay.portal.kernel.cache.PortalCache;
019
020 import java.io.Serializable;
021
022
026 public class MultiVMKeyPoolCacheListener implements CacheListener {
027
028 public MultiVMKeyPoolCacheListener(PortalCache localPortalCache) {
029 _localPortalCache = localPortalCache;
030 }
031
032 @Override
033 public void notifyEntryEvicted(
034 PortalCache portalCache, Serializable key, Object value) {
035
036 _localPortalCache.remove(key);
037 }
038
039 @Override
040 public void notifyEntryExpired(
041 PortalCache portalCache, Serializable key, Object value) {
042
043 _localPortalCache.remove(key);
044 }
045
046 @Override
047 public void notifyEntryPut(
048 PortalCache portalCache, Serializable key, Object value) {
049
050 _localPortalCache.put(key, value);
051 }
052
053 @Override
054 public void notifyEntryRemoved(
055 PortalCache portalCache, Serializable key, Object value) {
056
057 _localPortalCache.remove(key);
058 }
059
060 @Override
061 public void notifyEntryUpdated(
062 PortalCache portalCache, Serializable key, Object value) {
063
064 _localPortalCache.put(key, value);
065 }
066
067 @Override
068 public void notifyRemoveAll(PortalCache portalCache) {
069 _localPortalCache.removeAll();
070 }
071
072 private PortalCache _localPortalCache;
073
074 }