com.alachisoft.ncache.client.util.CacheDataModification Maven / Gradle / Ivy
package com.alachisoft.ncache.client.util;
import com.alachisoft.ncache.client.CacheDataModificationListener;
import com.alachisoft.ncache.client.CacheEventArg;
public class CacheDataModification implements CacheDataModificationListener {
private CacheDataModificationListener listener;
protected final Object _syncPoint1 = new Object();
protected final Object _syncPoint2 = new Object();
public CacheDataModification(CacheDataModificationListener listener) {
this.listener = listener;
}
@Override
public void onCacheDataModified(String key, CacheEventArg eventArgs) {
try {
synchronized (_syncPoint1) {
this.listener.onCacheDataModified(key, eventArgs);
}
}
catch (Exception exp) {
throw exp;
}
}
@Override
public void onCacheCleared(String cacheName) {
try {
synchronized (_syncPoint2) {
this.listener.onCacheCleared(cacheName);
}
}
catch (Exception exp) {
throw exp;
}
}
}