[jboss-cvs] JBossCache/src-50/org/jboss/cache/pojo/interceptors/dynamic ...
Ben Wang
bwang at jboss.com
Thu Jul 13 12:53:13 EDT 2006
User: bwang
Date: 06/07/13 12:53:13
Modified: src-50/org/jboss/cache/pojo/interceptors/dynamic
CacheFieldInterceptor.java
Log:
Minor stuffs
Revision Changes Path
1.5 +43 -43 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.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- CacheFieldInterceptor.java 13 Jul 2006 15:56:12 -0000 1.4
+++ CacheFieldInterceptor.java 13 Jul 2006 16:53:13 -0000 1.5
@@ -23,8 +23,8 @@
import org.jboss.cache.pojo.PojoTreeCache;
import org.jboss.cache.pojo.CachedType;
import org.jboss.cache.pojo.PojoReference;
+import org.jboss.cache.pojo.InternalConstant;
import org.jboss.cache.pojo.impl.PojoCacheImpl;
-import org.jboss.cache.pojo.impl.InternalConstant;
import java.lang.reflect.Field;
import java.util.Iterator;
@@ -38,19 +38,19 @@
public class CacheFieldInterceptor implements BaseInterceptor
{
private final Log log_ = LogFactory.getLog(CacheFieldInterceptor.class);
- private PojoTreeCache cache;
- private PojoCacheImpl pCache;
- private CachedType type;
- private Fqn fqn;
- private String name;
- private PojoReference pojoReference;
+ private PojoTreeCache cache_;
+ private PojoCacheImpl pCache_;
+ private CachedType type_;
+ private Fqn fqn_;
+ private String name_;
+ private PojoReference pojoReference_;
public CacheFieldInterceptor(PojoCacheImpl pCache, Fqn fqn, CachedType type)
{
- this.pCache = pCache;
- cache = (PojoTreeCache)this.pCache.getCache();
- this.fqn = fqn;
- this.type = type;
+ this.pCache_ = pCache;
+ cache_ = (PojoTreeCache)this.pCache_.getCache();
+ this.fqn_ = fqn;
+ this.type_ = type;
}
public CacheFieldInterceptor()
@@ -59,7 +59,7 @@
public PojoReference getAopInstance()
{
- return pojoReference;
+ return pojoReference_;
}
public Object clone()
@@ -79,16 +79,16 @@
public void setAopInstance(PojoReference pojoReference)
{
- this.pojoReference = pojoReference;
+ this.pojoReference_ = pojoReference;
}
public String getName()
{
- if (name == null)
+ if (name_ == null)
{
- this.name = "CacheFieldInterceptor on [" + fqn + "]";
+ this.name_ = "CacheFieldInterceptor on [" + fqn_ + "]";
}
- return name;
+ return name_;
}
public Object invoke(Invocation invocation) throws Throwable
@@ -114,18 +114,18 @@
Field field = fieldInvocation.getField();
// Only if this field is replicatable. static, transient and final are not.
- CachedType fieldType = pCache.getCachedType(field.getType());
- CachedType parentType = pCache.getCachedType(field.getDeclaringClass());
+ CachedType fieldType = pCache_.getCachedType(field.getType());
+ CachedType parentType = pCache_.getCachedType(field.getDeclaringClass());
if (!isNonReplicatable(field, advisor, parentType))
{
Object value = ((FieldWriteInvocation) fieldInvocation).getValue();
if (fieldType.isImmediate() || hasSerializableAnnotation(field, advisor, parentType))
{
- cache.put(fqn, field.getName(), value);
+ cache_.put(fqn_, field.getName(), value);
} else
{
- //cache.putObject(((Fqn)fqn.clone()).add(field.getName()), value);
- pCache.putObject(new Fqn(fqn, field.getName()), value);
+ //cache_.putObject(((Fqn)fqn_.clone()).add(field.getName()), value);
+ pCache_.putObject(new Fqn(fqn_, field.getName()), value);
}
}
@@ -137,18 +137,18 @@
Advisor advisor = fieldInvocation.getAdvisor();
// Only if this field is replicatable
- CachedType fieldType = pCache.getCachedType(field.getType());
- CachedType parentType = pCache.getCachedType(field.getDeclaringClass());
+ CachedType fieldType = pCache_.getCachedType(field.getType());
+ CachedType parentType = pCache_.getCachedType(field.getDeclaringClass());
if (!isNonReplicatable(field, advisor, parentType))
{
Object result;
if (fieldType.isImmediate() || hasSerializableAnnotation(field, advisor, parentType))
{
- result = cache.get(fqn, field.getName());
+ result = cache_.get(fqn_, field.getName());
} else
{
- //result = cache.getObject(((Fqn)fqn.clone()).add(field.getName()));
- result = pCache.getObject(new Fqn(fqn, field.getName()));
+ //result = cache_.getObject(((Fqn)fqn_.clone()).add(field.getName()));
+ result = pCache_.getObject(new Fqn(fqn_, field.getName()));
}
// if result is null, we need to make sure the in-memory reference is null
@@ -166,10 +166,10 @@
{
if (log_.isTraceEnabled())
{
- log_.trace("invoke(): DataNode on fqn: " + fqn + " has obviously been evicted. Will need to reconstruct it");
+ log_.trace("invoke(): DataNode on fqn_: " + fqn_ + " has obviously been evicted. Will need to reconstruct it");
}
- pCache.putObject(fqn, value);
+ pCache_.putObject(fqn_, value);
}
}
}
@@ -205,7 +205,7 @@
}
/**
- * Check if the pojo is detached already. If it is and we still have the cache interceptor on
+ * Check if the pojo is detached already. If it is and we still have the cache_ interceptor on
* this pojo, we will go ahead and remove it since it should not be there in the first place.
*
* @param invocation
@@ -213,7 +213,7 @@
private boolean isPojoDetached(Invocation invocation)
{
boolean detached = false;
- if (!cache.exists(fqn, InternalConstant.CLASS_INTERNAL))
+ if (!cache_.exists(fqn_, InternalConstant.CLASS_INTERNAL))
{
detached = true;
Object obj = invocation.getTargetObject();
@@ -226,7 +226,7 @@
{
if (log_.isDebugEnabled())
{
- log_.debug("isPojoDetached(): removed cache interceptor fqn: " + fqn + " interceptor: " + interceptor);
+ log_.debug("isPojoDetached(): removed cache interceptor fqn_: " + fqn_ + " interceptor: " + interceptor);
}
advisor.removeInterceptor(interceptor.getName());
}
@@ -237,7 +237,7 @@
protected void checkCacheConsistency() throws Exception
{
- if (this != cache.peek(fqn, PojoReference.KEY))
+ if (this != cache_.peek(fqn_, PojoReference.KEY))
{
throw new RuntimeException("Cache inconsistency: Outdated PojoReference");
}
@@ -247,19 +247,19 @@
{
// fill objects
- for (Iterator i = type.getFields().iterator(); i.hasNext();)
+ for (Iterator i = type_.getFields().iterator(); i.hasNext();)
{
Field field = (Field) (((FieldPersistentReference) i.next())).get();
- CachedType fieldType = pCache.getCachedType(field.getType());
+ CachedType fieldType = pCache_.getCachedType(field.getType());
Object value = null;
if (fieldType.isImmediate())
{
- value = cache.get(fqn, field.getName());
+ value = cache_.get(fqn_, field.getName());
} else
{
- // value = removeObject(fqn+TreeCache.SEPARATOR+field.getName());
- //value = cache.getObject(((Fqn)fqn.clone()).add(field.getName()));
- value = pCache.getObject(new Fqn(fqn, field.getName()));
+ // value = removeObject(fqn_+TreeCache.SEPARATOR+field.getName());
+ //value = cache_.getObject(((Fqn)fqn_.clone()).add(field.getName()));
+ value = pCache_.getObject(new Fqn(fqn_, field.getName()));
}
// System.out.println("Setting field " + field.getName() + "[" + field.getDeclaringClass() + "] of "+ target.getClass() + " to " + value);
field.set(target, value);
@@ -268,22 +268,22 @@
boolean isChildOf(Fqn parentFqn)
{
- return fqn.isChildOf(parentFqn);
+ return fqn_.isChildOf(parentFqn);
}
-// void setFqn(Fqn fqn)
+// void setFqn(Fqn fqn_)
// {
-// this.fqn = fqn;
+// this.fqn_ = fqn_;
// }
public Fqn getFqn()
{
- return fqn;
+ return fqn_;
}
public void setFqn(Fqn fqn)
{
- this.fqn = fqn;
+ this.fqn_ = fqn;
}
}
More information about the jboss-cvs-commits
mailing list