[jboss-cvs] JBossCache/src/org/jboss/cache/pojo/impl ...
Jason Thomas Greene
jgreene at jboss.com
Thu Jun 21 13:43:58 EDT 2007
User: jgreene
Date: 07/06/21 13:43:58
Modified: src/org/jboss/cache/pojo/impl AdvisedPojoHandler.java
Log:
Fix JBCACHE-1110
Intial patch from vincent.marquez at gmail.com
Revision Changes Path
1.8 +21 -17 JBossCache/src/org/jboss/cache/pojo/impl/AdvisedPojoHandler.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: AdvisedPojoHandler.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/pojo/impl/AdvisedPojoHandler.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- AdvisedPojoHandler.java 1 Jun 2007 02:02:25 -0000 1.7
+++ AdvisedPojoHandler.java 21 Jun 2007 17:43:58 -0000 1.8
@@ -7,37 +7,37 @@
package org.jboss.cache.pojo.impl;
+import java.lang.reflect.Field;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.aop.Advised;
import org.jboss.aop.Advisor;
import org.jboss.aop.ClassInstanceAdvisor;
import org.jboss.aop.InstanceAdvisor;
+import org.jboss.cache.Cache;
import org.jboss.cache.CacheException;
-import org.jboss.cache.CacheSPI;
import org.jboss.cache.Fqn;
import org.jboss.cache.pojo.interceptors.dynamic.CacheFieldInterceptor;
import org.jboss.cache.pojo.memory.FieldPersistentReference;
import org.jboss.cache.pojo.util.AopUtil;
-import java.lang.reflect.Field;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
/**
* Handling the advised pojo operations. No consideration of object graph here.
*
* @author Ben Wang
* Date: Aug 4, 2005
- * @version $Id: AdvisedPojoHandler.java,v 1.7 2007/06/01 02:02:25 jgreene Exp $
+ * @version $Id: AdvisedPojoHandler.java,v 1.8 2007/06/21 17:43:58 jgreene Exp $
*/
class AdvisedPojoHandler
{
private final Log log = LogFactory.getLog(AdvisedPojoHandler.class);
- private CacheSPI cache_;
+ private Cache<Object, Object> cache_;
private PojoCacheImpl pCache_;
private PojoUtil util_;
@@ -45,7 +45,7 @@
PojoUtil util)
{
pCache_ = pCache;
- cache_ = (CacheSPI) pCache_.getCache();
+ cache_ = pCache_.getCache();
util_ = util;
}
@@ -200,8 +200,7 @@
}
}
- Object remove(Fqn fqn, Object result, Class clazz
- ) throws CacheException
+ Object remove(Fqn fqn, Object result, Class clazz) throws CacheException
{
CachedType type = pCache_.getCachedType(clazz);
InstanceAdvisor advisor = ((Advised) result)._getInstanceAdvisor();
@@ -220,7 +219,12 @@
// If this Collection class, we are returning the original value already
util_.inMemorySubstitution(result, field, value);
}
-
+ }
+ else
+ {
+ // Update last known field state
+ value = cache_.get(fqn, field.getName());
+ util_.inMemorySubstitution(result, field, value);
}
}
More information about the jboss-cvs-commits
mailing list