[jboss-cvs] JBossCache/src-50/org/jboss/cache/pojo/interceptors/dynamic ...
Ben Wang
bwang at jboss.com
Sun Sep 17 02:18:50 EDT 2006
User: bwang
Date: 06/09/17 02:18:50
Modified: src-50/org/jboss/cache/pojo/interceptors/dynamic
CacheFieldInterceptor.java
Log:
Added undo for in-memory state
Revision Changes Path
1.11 +6 -1 JBossCache/src-50/org/jboss/cache/pojo/interceptors/dynamic/CacheFieldInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheFieldInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src-50/org/jboss/cache/pojo/interceptors/dynamic/CacheFieldInterceptor.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- CacheFieldInterceptor.java 5 Sep 2006 06:11:25 -0000 1.10
+++ CacheFieldInterceptor.java 17 Sep 2006 06:18:49 -0000 1.11
@@ -26,6 +26,7 @@
import org.jboss.cache.pojo.CachedType;
import org.jboss.cache.pojo.PojoInstance;
import org.jboss.cache.pojo.PojoCacheAlreadyDetachedException;
+import org.jboss.cache.pojo.PojoUtil;
import org.jboss.cache.pojo.impl.PojoCacheImpl;
import java.lang.reflect.Field;
@@ -46,6 +47,7 @@
private Fqn fqn_;
private String name_;
private PojoInstance pojoInstance_;
+ private PojoUtil util_;
public CacheFieldInterceptor(PojoCacheImpl pCache, Fqn fqn, CachedType type)
{
@@ -53,6 +55,7 @@
cache_ = (CacheSPI)this.pCache_.getCache();
this.fqn_ = fqn;
this.type_ = type;
+ util_ = new PojoUtil();
}
public CacheFieldInterceptor()
@@ -122,9 +125,9 @@
// Only if this field is replicatable. static, transient and final are not.
CachedType fieldType = pCache_.getCachedType(field.getType());
CachedType parentType = pCache_.getCachedType(field.getDeclaringClass());
+ Object value = ((FieldWriteInvocation) fieldInvocation).getValue();
if (!isNonReplicatable(field, advisor, parentType))
{
- Object value = ((FieldWriteInvocation) fieldInvocation).getValue();
if (fieldType.isImmediate() || hasSerializableAnnotation(field, advisor, parentType))
{
cache_.put(fqn_, field.getName(), value);
@@ -135,6 +138,8 @@
}
}
+ Object obj = fieldInvocation.getTargetObject();
+ util_.inMemorySubstitution(obj, field, value);
} else if (invocation instanceof FieldReadInvocation)
{
FieldInvocation fieldInvocation =
More information about the jboss-cvs-commits
mailing list