boolean collectionObjectPut(Fqn fqn, Object obj) throws CacheException {
boolean isCollection = false;
CachedType type = null;
AbstractCollectionInterceptor interceptor = null;
if(obj instanceof ClassProxy)
{
Class originalClaz = obj.getClass().getSuperclass();
interceptor = CollectionInterceptorUtil.getInterceptor((ClassProxy)obj);
type = cache_.getCachedType(originalClaz);
} else
{
type = cache_.getCachedType(obj.getClass());
}
if(obj instanceof ClassProxy)
{
// A proxy here. We may have multiple references.
if(interceptor == null)
{
if(log.isDebugEnabled())
{
log.debug("collectionObjectPut(): null interceptor. Could be removed previously. "+fqn);
}
} else
{
if( interceptor.isAttached() ) // If it is not attached, it is not active.
{
// Let's check for object graph, e.g., multiple and circular references first
if (graphHandler_.objectGraphPut(fqn, interceptor, type, obj)) { // found cross references
return true;
}
} else
{
// Re-attach the interceptor to this fqn.
boolean copyToCache = true;
interceptor.attach(fqn, copyToCache);
internal_.putAopClazz(fqn, type.getType());
internal_.setPojo(fqn, obj);
return true; // we are done
}
}