public void interceptAfterRemove(String mapName, Object value) { List<MapInterceptor> interceptors = getMapContainer(mapName).getInterceptors(); if (!interceptors.isEmpty()) { for (MapInterceptor interceptor : interceptors) { value = toObject(value); interceptor.afterRemove(value); } } }
public void interceptAfterPut(String mapName, Object newValue) { List<MapInterceptor> interceptors = getMapContainer(mapName).getInterceptors(); if (!interceptors.isEmpty()) { newValue = toObject(newValue); for (MapInterceptor interceptor : interceptors) { interceptor.afterPut(newValue); } } }
public Object interceptRemove(String mapName, Object value) { List<MapInterceptor> interceptors = getMapContainer(mapName).getInterceptors(); Object result = null; if (!interceptors.isEmpty()) { result = toObject(value); for (MapInterceptor interceptor : interceptors) { Object temp = interceptor.interceptRemove(result); if (temp != null) { result = temp; } } } return result == null ? value : result; }
public Object interceptPut(String mapName, Object oldValue, Object newValue) { List<MapInterceptor> interceptors = getMapContainer(mapName).getInterceptors(); Object result = null; if (!interceptors.isEmpty()) { result = toObject(newValue); oldValue = toObject(oldValue); for (MapInterceptor interceptor : interceptors) { Object temp = interceptor.interceptPut(oldValue, result); if (temp != null) { result = temp; } } } return result == null ? newValue : result; }