}
// Check for Collection field so we need to restore the original reference.
if(value instanceof ClassProxy)
{
Interceptor interceptor = CollectionInterceptorUtil.getInterceptor((ClassProxy)value);
value = ((AbstractCollectionInterceptor)interceptor).getOriginalInstance();
}
try {
field.set(result, value);
} catch (IllegalAccessException e) {
throw new CacheException("field access failed", e);
}
}
// batch remove
cache_.removeData(fqn);
// Determine if we want to keep the interceptor for later use.
if(removeCacheInterceptor) {
CacheInterceptor interceptor = (CacheInterceptor) AopUtil.findCacheInterceptor(advisor);
// Remember to remove the interceptor from in-memory object but make sure it belongs to me first.
if (interceptor != null)
{
if (log.isDebugEnabled()) {
log.debug("regularRemoveObject(): removed cache interceptor fqn: " + fqn + " interceptor: "+interceptor);
}
advisor.removeInterceptor(interceptor.getName());
cache_.addUndoInterceptor(advisor, interceptor, ModificationEntry.INTERCEPTOR_REMOVE);
}
}
}