JBoss Cache SVN: r4861 - core/branches/1.4.X/tests/functional/org/jboss/cache/aop/loader.
by jbosscache-commits@lists.jboss.org
Author: galder.zamarreno(a)jboss.com
Date: 2007-12-14 08:20:22 -0500 (Fri, 14 Dec 2007)
New Revision: 4861
Modified:
core/branches/1.4.X/tests/functional/org/jboss/cache/aop/loader/FileCacheLoaderAopCollectionsTest.java
Log:
[PCACHE-58] Tidy up and addition of Map test. In memory Collection load test has been commented as it was only used for comparison between the in memory loaded Collection and the CacheLoader loaded Collection case.
Modified: core/branches/1.4.X/tests/functional/org/jboss/cache/aop/loader/FileCacheLoaderAopCollectionsTest.java
===================================================================
--- core/branches/1.4.X/tests/functional/org/jboss/cache/aop/loader/FileCacheLoaderAopCollectionsTest.java 2007-12-14 04:58:12 UTC (rev 4860)
+++ core/branches/1.4.X/tests/functional/org/jboss/cache/aop/loader/FileCacheLoaderAopCollectionsTest.java 2007-12-14 13:20:22 UTC (rev 4861)
@@ -15,8 +15,14 @@
import java.util.List;
import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
/**
+ * Test case for testing Collection manipulation where Pojos are loaded/stored in a CacheLoader.
+ *
+ * @author ?
+ * @author <a href="mailto:galder.zamarreno@jboss.com">Galder Zamarreno</a>
*/
public class FileCacheLoaderAopCollectionsTest extends CacheLoaderTestsBase
{
@@ -70,75 +76,116 @@
{
}
- public void testPojoCollectionRemove() throws Exception
+ public void testPojoListLoadAndRemoveAfterRestart() throws Exception
{
String fqn = "/list";
- Person brian = new Person(); // instantiate a Person object named joe
- brian.setName("Brian");
+ Person brian = createPerson("Brian");
+ Person manik = createPerson("Manik");
- Person manik = new Person(); // instantiate a Person object named joe
- manik.setName("Manik");
-
- List list = new ArrayList();
+ List<Person> list = new ArrayList<Person>();
list.add(brian);
list.add(manik);
cache.putObject(fqn, list);
- List proxyList = (List) cache.getObject(fqn);
+ List<Person> proxyList = (List<Person>) cache.getObject(fqn);
- brian = (Person)proxyList.get(0);
+ brian = proxyList.get(0);
assertEquals("Brian", brian.getName());
- manik = (Person)proxyList.get(1);
+ manik = proxyList.get(1);
assertEquals("Manik", manik.getName());
- proxyList.remove(0);
+ stopCache();
- manik = (Person)proxyList.get(0);
+ startCache();
+
+ proxyList = (List) cache.getObject(fqn);
+
+ brian = proxyList.get(0);
+ assertEquals("Brian", brian.getName());
+ manik = proxyList.get(1);
assertEquals("Manik", manik.getName());
+
+ brian = proxyList.remove(0);
+ assertEquals("Brian", brian.getName());
+
+ manik = proxyList.get(0);
+ assertEquals("Manik", manik.getName());
}
- public void testPojoCollectionLoadAndRemoveAfterRestart() throws Exception
+ public void testPojoMapLoadAndRemoveAfterRestart() throws Exception
{
- String fqn = "/list";
+ String fqn = "/map";
- Person brian = new Person(); // instantiate a Person object named joe
- brian.setName("Brian");
+ Person brian = createPerson("Brian");
+ Person manik = createPerson("Manik");
- Person manik = new Person(); // instantiate a Person object named joe
- manik.setName("Manik");
+ Map<String, Person> map = new HashMap<String, Person>();
+ map.put("key-brian", brian);
+ map.put("key-manik", manik);
- Person bela = new Person(); // instantiate a Person object named joe
- bela.setName("Bela");
+ cache.putObject(fqn, map);
- List list = new ArrayList();
- list.add(brian);
- list.add(manik);
+ Map<String, Person> proxyMap = (Map<String, Person>) cache.getObject(fqn);
- cache.putObject(fqn, list);
-
- List proxyList = (List) cache.getObject(fqn);
-
- brian = (Person)proxyList.get(0);
+ brian = proxyMap.get("key-brian");
assertEquals("Brian", brian.getName());
- manik = (Person)proxyList.get(1);
+ manik = proxyMap.get("key-manik");
assertEquals("Manik", manik.getName());
stopCache();
startCache();
- proxyList = (List) cache.getObject(fqn);
+ proxyMap = (Map) cache.getObject(fqn);
- brian = (Person)proxyList.get(0);
+ brian = proxyMap.get("key-brian");
assertEquals("Brian", brian.getName());
- manik = (Person)proxyList.get(1);
+ manik = proxyMap.get("key-manik");
assertEquals("Manik", manik.getName());
- proxyList.remove(0);
+ brian = proxyMap.remove("key-brian");
+ assertEquals("Brian", brian.getName());
- manik = (Person)proxyList.get(0);
+ manik = (Person)proxyMap.get("key-manik");
assertEquals("Manik", manik.getName());
}
+
+// /**
+// * Test for removal of Collection element, where the Collection has been loaded with Pojos created in the test. I
+// * used this to compare it to the newly added tests where the Collection is loaded from the CacheLoader.
+// */
+// public void testPojoCollectionRemove() throws Exception
+// {
+// String fqn = "/list";
+//
+// Person brian = createPerson("Brian");
+// Person manik = createPerson("Manik");
+//
+// List<Person> list = new ArrayList<Person>();
+// list.add(brian);
+// list.add(manik);
+//
+// cache.putObject(fqn, list);
+//
+// List<Person> proxyList = (List<Person>) cache.getObject(fqn);
+//
+// brian = proxyList.get(0);
+// assertEquals("Brian", brian.getName());
+// manik = proxyList.get(1);
+// assertEquals("Manik", manik.getName());
+//
+// proxyList.remove(0);
+//
+// manik = proxyList.get(0);
+// assertEquals("Manik", manik.getName());
+// }
+
+ protected Person createPerson(String name)
+ {
+ Person p = new Person(); // instantiate a Person object named joe
+ p.setName(name);
+ return p;
+ }
}
16 years, 4 months
JBoss Cache SVN: r4860 - pojo/trunk/assembly.
by jbosscache-commits@lists.jboss.org
Author: jason.greene(a)jboss.com
Date: 2007-12-13 23:58:12 -0500 (Thu, 13 Dec 2007)
New Revision: 4860
Modified:
pojo/trunk/assembly/all.xml
pojo/trunk/assembly/bin.xml
Log:
chmod
Modified: pojo/trunk/assembly/all.xml
===================================================================
--- pojo/trunk/assembly/all.xml 2007-12-14 04:35:40 UTC (rev 4859)
+++ pojo/trunk/assembly/all.xml 2007-12-14 04:58:12 UTC (rev 4860)
@@ -46,11 +46,14 @@
<fileSet>
<directory>src/main/release</directory>
<outputDirectory/>
- <includes>
- <include>**/*</include>
- </includes>
</fileSet>
+ <fileSet>
+ <directory>src/main/release/bin</directory>
+ <outputDirectory>bin</outputDirectory>
+ <fileMode>0755</fileMode>
+ </fileSet>
+
<!-- docs -->
<fileSet>
<directory>target/site/apidocs</directory>
Modified: pojo/trunk/assembly/bin.xml
===================================================================
--- pojo/trunk/assembly/bin.xml 2007-12-14 04:35:40 UTC (rev 4859)
+++ pojo/trunk/assembly/bin.xml 2007-12-14 04:58:12 UTC (rev 4860)
@@ -27,11 +27,14 @@
<fileSet>
<directory>src/main/release</directory>
<outputDirectory/>
- <includes>
- <include>**/*</include>
- </includes>
</fileSet>
+ <fileSet>
+ <directory>src/main/release/bin</directory>
+ <outputDirectory>bin</outputDirectory>
+ <fileMode>0755</fileMode>
+ </fileSet>
+
</fileSets>
<dependencySets>
<dependencySet>
16 years, 4 months
JBoss Cache SVN: r4859 - in pojo/trunk: src/main/release and 1 other directories.
by jbosscache-commits@lists.jboss.org
Author: jason.greene(a)jboss.com
Date: 2007-12-13 23:35:40 -0500 (Thu, 13 Dec 2007)
New Revision: 4859
Added:
pojo/trunk/src/main/release/bin/
pojo/trunk/src/main/release/bin/pojo-run
Modified:
pojo/trunk/assembly/all.xml
pojo/trunk/assembly/bin.xml
Log:
Add pojo-run utility
Modified: pojo/trunk/assembly/all.xml
===================================================================
--- pojo/trunk/assembly/all.xml 2007-12-14 03:53:27 UTC (rev 4858)
+++ pojo/trunk/assembly/all.xml 2007-12-14 04:35:40 UTC (rev 4859)
@@ -47,8 +47,7 @@
<directory>src/main/release</directory>
<outputDirectory/>
<includes>
- <include>**/*.txt</include>
- <include>**/*.xml</include>
+ <include>**/*</include>
</includes>
</fileSet>
Modified: pojo/trunk/assembly/bin.xml
===================================================================
--- pojo/trunk/assembly/bin.xml 2007-12-14 03:53:27 UTC (rev 4858)
+++ pojo/trunk/assembly/bin.xml 2007-12-14 04:35:40 UTC (rev 4859)
@@ -28,8 +28,7 @@
<directory>src/main/release</directory>
<outputDirectory/>
<includes>
- <include>**/*.txt</include>
- <include>**/*.xml</include>
+ <include>**/*</include>
</includes>
</fileSet>
Added: pojo/trunk/src/main/release/bin/pojo-run
===================================================================
--- pojo/trunk/src/main/release/bin/pojo-run (rev 0)
+++ pojo/trunk/src/main/release/bin/pojo-run 2007-12-14 04:35:40 UTC (rev 4859)
@@ -0,0 +1,75 @@
+#!/bin/sh
+DIRNAME=`dirname $0`
+POJO_HOME=`cd $DIRNAME/..; pwd`
+
+if [ $# -lt 1 ]; then
+ echo Utility which executes the JVM with properties needed by POJO Cache for load-time instrumentation.
+ echo
+ echo Usage:
+ echo "pojo-run [-classpath <classpath>] <main-class> [arguments...] "
+ echo " classpath: Classpath of your sourcefiles and all required libraries"
+ echo " main-class: Normal Java main class"
+ echo
+ echo Example:
+ echo " pojo-run -classpath myclasses org.foo.Main"
+ exit 1
+fi
+
+cygwin=false;
+case "`uname`" in
+ CYGWIN*)
+ cygwin=true
+ ;;
+esac
+
+AOP_FILE="pojocache-aop.xml"
+AOP_PATH="$POJO_HOME/$AOP_FILE"
+
+if [ ! -f "$AOP_PATH" ]; then
+ AOP_PATH="$POJO_HOME/etc/META-INF/$AOP_FILE"
+
+ if [ ! -f "$AOP_PATH" ]; then
+ echo "Could not locate pojocache-aop.xml in $POJO_HOME or $POJO_HOME/etc/META-INF"
+ exit 1
+ fi
+fi
+
+POJO_CLASSPATH=.:$POJO_HOME/jbosscache-pojo.jar
+
+for i in $POJO_HOME/lib/*.jar
+do
+ POJO_CLASSPATH="$POJO_CLASSPATH:${i}"
+done
+
+while [ $# -ge 1 ]; do
+ case $1 in
+ "-classpath") POJO_CLASSPATH="$POJO_CLASSPATH:$2"; shift;;
+ *) args="$args \"$1\""; echo $1;;
+ esac
+ shift
+done
+
+
+#Check for cygwin and convert path if necessary
+if $cygwin; then
+ POJO_CLASSPATH=`cygpath --path --windows $POJO_CLASSPATH`
+fi
+
+# Setup the JVM
+if [ "x$JAVA" = "x" ]; then
+ if [ "x$JAVA_HOME" != "x" ]; then
+ JAVA="$JAVA_HOME/bin/java"
+ else
+ JAVA="java"
+ fi
+fi
+
+#JPDA options. Uncomment and modify as appropriate to enable remote debugging .
+#JAVA_OPTS="-classic -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n $JAVA_OPTS"
+
+# Execute the JVM
+eval "$JAVA" $JAVA_OPTS \
+ -javaagent:"$POJO_HOME/lib/jboss-aop.jar" \
+ -Djboss.aop.path="$AOP_PATH" \
+ -classpath "$POJO_CLASSPATH" \
+ "$args"
Property changes on: pojo/trunk/src/main/release/bin/pojo-run
___________________________________________________________________
Name: svn:executable
+ *
16 years, 4 months
JBoss Cache SVN: r4858 - in pojo/trunk/src/test/java/org/jboss/cache/pojo: test and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: jason.greene(a)jboss.com
Date: 2007-12-13 22:53:27 -0500 (Thu, 13 Dec 2007)
New Revision: 4858
Modified:
pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalTest.java
pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedTest.java
pojo/trunk/src/test/java/org/jboss/cache/pojo/test/Person.java
Log:
Fix regression
Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalTest.java 2007-12-14 01:58:52 UTC (rev 4857)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalTest.java 2007-12-14 03:53:27 UTC (rev 4858)
@@ -58,7 +58,12 @@
private Person createPerson(String id, String name, int age)
{
- Person p = new Person();
+ return createPerson(id, name, age, null);
+ }
+
+ private Person createPerson(String id, String name, int age, Map<String, String> finalMap)
+ {
+ Person p = new Person(finalMap);
p.setName(name);
p.setAge(age);
Address add = new Address();
@@ -182,7 +187,7 @@
public void testFinalMap() throws Exception
{
log.info("testMap() ....");
- Person ben = createPerson("/person/test1", "Ben Wang", 40);
+ Person ben = createPerson("/person/test1", "Ben Wang", 40, new HashMap<String, String>());
assertEquals((Object) "Ben Wang", ben.getName());
Map<String, String> map = ben.getFinalMap();
if (!(map instanceof ClassProxy))
Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedTest.java 2007-12-14 01:58:52 UTC (rev 4857)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedTest.java 2007-12-14 03:53:27 UTC (rev 4858)
@@ -4,7 +4,9 @@
import static org.testng.AssertJUnit.assertNull;
import static org.testng.AssertJUnit.assertTrue;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -49,7 +51,12 @@
private Person createPerson(String id, String name, int age)
{
- Person p = new Person();
+ return createPerson(id, name, age, null);
+ }
+
+ private Person createPerson(String id, String name, int age, Map<String, String> map)
+ {
+ Person p = new Person(map);
p.setName(name);
p.setAge(age);
cache.attach(id, p);
@@ -115,7 +122,7 @@
public void testFinal() throws Exception
{
- Person jason = createPerson("/person/test1", "Jason Greene", 28);
+ Person jason = createPerson("/person/test1", "Jason Greene", 28, new HashMap<String, String>());
jason.getFinalMap().put("test1", "testa");
jason.getFinalMap().put("test2", "testb");
Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/test/Person.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/test/Person.java 2007-12-14 01:58:52 UTC (rev 4857)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/test/Person.java 2007-12-14 03:53:27 UTC (rev 4858)
@@ -46,8 +46,13 @@
public Person()
{
- finalMap = new HashMap<String, String>();
+ this(null);
}
+
+ public Person(Map<String, String> map)
+ {
+ finalMap = map;
+ }
public String getName()
{
16 years, 4 months
JBoss Cache SVN: r4857 - in pojo/trunk/src: main/java/org/jboss/cache/pojo/interceptors/dynamic and 3 other directories.
by jbosscache-commits@lists.jboss.org
Author: jason.greene(a)jboss.com
Date: 2007-12-13 20:58:52 -0500 (Thu, 13 Dec 2007)
New Revision: 4857
Modified:
pojo/trunk/src/main/java/org/jboss/cache/pojo/impl/AdvisedPojoHandler.java
pojo/trunk/src/main/java/org/jboss/cache/pojo/impl/CachedType.java
pojo/trunk/src/main/java/org/jboss/cache/pojo/interceptors/dynamic/CacheFieldInterceptor.java
pojo/trunk/src/main/resources/META-INF/pojocache-aop.xml
pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalTest.java
pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedTest.java
pojo/trunk/src/test/java/org/jboss/cache/pojo/test/Person.java
Log:
PCACHE-57 Add support for final fields
Modified: pojo/trunk/src/main/java/org/jboss/cache/pojo/impl/AdvisedPojoHandler.java
===================================================================
--- pojo/trunk/src/main/java/org/jboss/cache/pojo/impl/AdvisedPojoHandler.java 2007-12-14 00:34:14 UTC (rev 4856)
+++ pojo/trunk/src/main/java/org/jboss/cache/pojo/impl/AdvisedPojoHandler.java 2007-12-14 01:58:52 UTC (rev 4857)
@@ -26,6 +26,7 @@
import org.jboss.cache.pojo.memory.FieldPersistentReference;
import org.jboss.cache.pojo.util.AopUtil;
import org.jboss.cache.pojo.util.Instantiator;
+import org.jboss.cache.pojo.util.ObjectUtil;
/**
* Handling the advised pojo operations. No consideration of object graph here.
@@ -49,14 +50,33 @@
util_ = util;
}
- public Object get(Fqn<?> fqn, Class<?> clazz, PojoInstance pojoInstance)
- throws CacheException
+ public Object get(Fqn<?> fqn, Class<?> clazz, PojoInstance pojoInstance) throws CacheException
{
CachedType type = pCache_.getCachedType(clazz);
- Object obj =Instantiator.newInstance(clazz);
+ Object obj = Instantiator.newInstance(clazz);
+
+ // Eager initialize final fields, since these may not be intercepted
+
+ try
+ {
+ for (FieldPersistentReference ref : type.getFinalFields())
+ {
+ Field field = ref.getField();
+ Object result;
+
+ if (CachedType.isSimpleAttribute(field))
+ result = cache_.get(fqn, field.getName());
+ else
+ result = pCache_.getObject(fqn, field.getName());
+
+ field.set(obj, result);
+ }
+ }
+ catch (Exception e)
+ {
+ log.warn("Could not initialize final fields on object: " + ObjectUtil.identityString(obj));
+ }
- // TODO Need to populate the object from the cache as well.
- // Insert interceptor at runtime
InstanceAdvisor advisor = ((Advised) obj)._getInstanceAdvisor();
CacheFieldInterceptor interceptor = new CacheFieldInterceptor(pCache_, fqn, type);
interceptor.setAopInstance(pojoInstance);
Modified: pojo/trunk/src/main/java/org/jboss/cache/pojo/impl/CachedType.java
===================================================================
--- pojo/trunk/src/main/java/org/jboss/cache/pojo/impl/CachedType.java 2007-12-14 00:34:14 UTC (rev 4856)
+++ pojo/trunk/src/main/java/org/jboss/cache/pojo/impl/CachedType.java 2007-12-14 01:58:52 UTC (rev 4857)
@@ -31,8 +31,8 @@
public class CachedType
{
// Types that are considered "primitive".
- private static final Set immediates =
- new HashSet(Arrays.asList(new Object[]{
+ private static final Set<Object> immediates =
+ new HashSet<Object>(Arrays.asList(new Object[]{
String.class,
Boolean.class,
Double.class,
@@ -57,8 +57,9 @@
private boolean immediate;
// Java fields . Will use special FieldPersistentReference to prevent classloader leakage.
- private List fields = new ArrayList();
- private Map fieldMap = new HashMap();// Name -> CachedAttribute
+ private List<FieldPersistentReference> fields = new ArrayList<FieldPersistentReference>();
+ private List<FieldPersistentReference> finalFields = new ArrayList<FieldPersistentReference>();
+ private Map<String, FieldPersistentReference> fieldMap = new HashMap<String, FieldPersistentReference>();// Name -> CachedAttribute
public CachedType()
{
@@ -92,14 +93,19 @@
return immutable;
}
- public List getFields()
+ public List<FieldPersistentReference> getFields()
{
return fields;
}
+
+ public List<FieldPersistentReference> getFinalFields()
+ {
+ return finalFields;
+ }
public Field getField(String name)
{
- FieldPersistentReference ref = (FieldPersistentReference) fieldMap.get(name);
+ FieldPersistentReference ref = fieldMap.get(name);
if (ref == null) return null;
return (Field) ref.get();
}
@@ -209,7 +215,7 @@
for (int i = 0; i < classFields.length; i++)
{
Field f = classFields[i];
- if (isNonReplicatable(f)) continue;
+ if (isNonReplicable(f)) continue;
PrivilegedCode.setAccessible(f);
@@ -217,17 +223,20 @@
fields.add(persistentRef);
fieldMap.put(f.getName(), persistentRef);
+
+ if (Modifier.isFinal(f.getModifiers()))
+ finalFields.add(persistentRef);
}
}
- public static boolean isNonReplicatable(Field field)
+ public static boolean isNonReplicable(Field field)
{
int mods = field.getModifiers();
/**
* The following modifiers are ignored in the cache, i.e., they will not be stored in the cache.
* Whenever, user trying to access these fields, it will be accessed from the in-memory version.
*/
- return Modifier.isStatic(mods) || Modifier.isTransient(mods) || Modifier.isFinal(mods) ||
+ return Modifier.isStatic(mods) || Modifier.isTransient(mods) ||
field.isAnnotationPresent(org.jboss.cache.pojo.annotation.Transient.class);
}
Modified: pojo/trunk/src/main/java/org/jboss/cache/pojo/interceptors/dynamic/CacheFieldInterceptor.java
===================================================================
--- pojo/trunk/src/main/java/org/jboss/cache/pojo/interceptors/dynamic/CacheFieldInterceptor.java 2007-12-14 00:34:14 UTC (rev 4856)
+++ pojo/trunk/src/main/java/org/jboss/cache/pojo/interceptors/dynamic/CacheFieldInterceptor.java 2007-12-14 01:58:52 UTC (rev 4857)
@@ -112,7 +112,7 @@
// Only if this field is replicatable. static, transient and final are not.
CachedType fieldType = pCache_.getCachedType(field.getType());
Object value = ((FieldWriteInvocation) fieldInvocation).getValue();
- if (!CachedType.isNonReplicatable(field))
+ if (!CachedType.isNonReplicable(field))
{
if (CachedType.isSimpleAttribute(field))
{
@@ -136,7 +136,7 @@
// Only if this field is replicatable
CachedType fieldType = pCache_.getCachedType(field.getType());
- if (!CachedType.isNonReplicatable(field))
+ if (!CachedType.isNonReplicable(field))
{
Object result;
if (CachedType.isSimpleAttribute(field))
Modified: pojo/trunk/src/main/resources/META-INF/pojocache-aop.xml
===================================================================
--- pojo/trunk/src/main/resources/META-INF/pojocache-aop.xml 2007-12-14 00:34:14 UTC (rev 4856)
+++ pojo/trunk/src/main/resources/META-INF/pojocache-aop.xml 2007-12-14 01:58:52 UTC (rev 4857)
@@ -137,10 +137,13 @@
instrumented as well.
-->
- <!-- If a POJO has PojoCachable annotation, it will be asepectized. -->
+ <!-- If a POJO has Replicable annotation, it will be asepectized. -->
<!--
Supports inheritance and polymorphism. It can either be a concrete class
or an interface. All sub-classes or interface implementors will be instrumeneted.
-->
<prepare expr="field(* $instanceof{(a)org.jboss.cache.pojo.annotation.Replicable}->*)" />
-</aop>
+
+ <!-- Work around that ensures annotated classes which do not access fields are instrumented -->
+ <introduction expr="class($instanceof{(a)org.jboss.cache.pojo.annotation.Replicable})"/>
+</aop>
\ No newline at end of file
Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalTest.java 2007-12-14 00:34:14 UTC (rev 4856)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalTest.java 2007-12-14 01:58:52 UTC (rev 4857)
@@ -154,6 +154,7 @@
}
}
+
public void testMap() throws Exception
{
log.info("testMap() ....");
@@ -178,7 +179,29 @@
assertEquals("Hobbies size", 2, hobbies.size());
log.debug("Hobbies is " + hobbies.toString());
}
+ public void testFinalMap() throws Exception
+ {
+ log.info("testMap() ....");
+ Person ben = createPerson("/person/test1", "Ben Wang", 40);
+ assertEquals((Object) "Ben Wang", ben.getName());
+ Map<String, String> map = ben.getFinalMap();
+ if (!(map instanceof ClassProxy))
+ {
+ fail("Final map is not an instance of ClassProxy");
+ }
+
+ map.put("test1", "testa");
+ map.put("test2", "testb");
+ assertEquals("Hobbies size", 2, map.size());
+ ben = (Person) cache_.detach("/person/test1");
+ map = ben.getFinalMap();
+ if (!(map instanceof HashMap))
+ {
+ fail("Final map is not an instance of HashMap");
+ }
+ }
+
public void testMapDetachAttach() throws Exception
{
log.info("testMapDetachATtach() ....");
Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedTest.java 2007-12-14 00:34:14 UTC (rev 4856)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/ReplicatedTest.java 2007-12-14 01:58:52 UTC (rev 4857)
@@ -112,6 +112,17 @@
((Person) cache1.find("/person/test1")).getCurrentStatus());
cache.detach("/person/test1");
}
+
+ public void testFinal() throws Exception
+ {
+ Person jason = createPerson("/person/test1", "Jason Greene", 28);
+ jason.getFinalMap().put("test1", "testa");
+ jason.getFinalMap().put("test2", "testb");
+
+ Person jason2 = (Person) cache1.find("/person/test1");
+ assertEquals("testa", jason2.getFinalMap().get("test1"));
+ assertEquals("testb", jason2.getFinalMap().get("test2"));
+ }
public void testModification() throws Exception
{
Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/test/Person.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/test/Person.java 2007-12-14 00:34:14 UTC (rev 4856)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/test/Person.java 2007-12-14 01:58:52 UTC (rev 4857)
@@ -7,6 +7,8 @@
package org.jboss.cache.pojo.test;
import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -40,10 +42,11 @@
private List<String> medication = null;
private static final int AGE1 = 50;
private static final int AGE2 = 60;
+ private final Map<String, String> finalMap;
public Person()
{
-
+ finalMap = new HashMap<String, String>();
}
public String getName()
@@ -162,6 +165,11 @@
{
this.languages = languages;
}
+
+ public Map<String, String> getFinalMap()
+ {
+ return this.finalMap;
+ }
public String toString()
{
16 years, 4 months
JBoss Cache SVN: r4856 - core/trunk/src/main/java/org/jboss/cache/factories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2007-12-13 19:34:14 -0500 (Thu, 13 Dec 2007)
New Revision: 4856
Modified:
core/trunk/src/main/java/org/jboss/cache/factories/InterceptorChainFactory.java
Log:
should NOT be a singleton anymore!
Modified: core/trunk/src/main/java/org/jboss/cache/factories/InterceptorChainFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/factories/InterceptorChainFactory.java 2007-12-14 00:13:14 UTC (rev 4855)
+++ core/trunk/src/main/java/org/jboss/cache/factories/InterceptorChainFactory.java 2007-12-14 00:34:14 UTC (rev 4856)
@@ -24,27 +24,11 @@
@DefaultFactoryFor(classes = Interceptor.class)
public class InterceptorChainFactory extends ComponentFactory
{
- private static InterceptorChainFactory singleton;
-
- private InterceptorChainFactory()
- {
- // private ctor
- }
-
public static InterceptorChainFactory getInstance()
{
- if (singleton == null)
- {
- synchronized (InterceptorChainFactory.class)
- {
- if (singleton == null) singleton = new InterceptorChainFactory();
- }
- }
-
- return singleton;
+ return new InterceptorChainFactory();
}
-
public Interceptor buildInterceptorChain() throws IllegalAccessException, ClassNotFoundException, InstantiationException
{
if (configuration.isNodeLockingOptimistic())
16 years, 4 months
JBoss Cache SVN: r4855 - core/trunk/src/test/java/org/jboss/cache/interceptors.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2007-12-13 19:13:14 -0500 (Thu, 13 Dec 2007)
New Revision: 4855
Modified:
core/trunk/src/test/java/org/jboss/cache/interceptors/EvictionInterceptorTest.java
Log:
patched test
Modified: core/trunk/src/test/java/org/jboss/cache/interceptors/EvictionInterceptorTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/interceptors/EvictionInterceptorTest.java 2007-12-13 23:54:19 UTC (rev 4854)
+++ core/trunk/src/test/java/org/jboss/cache/interceptors/EvictionInterceptorTest.java 2007-12-14 00:13:14 UTC (rev 4855)
@@ -51,11 +51,15 @@
@BeforeMethod(alwaysRun = true)
public void setUp() throws Exception
{
- regionManager = new RegionManager();
+ cache = (CacheSPI<Object, Object>) DefaultCacheFactory.getInstance().createCache(false);
+ cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
+ cache.getConfiguration().setIsolationLevel(IsolationLevel.SERIALIZABLE);
+
+ regionManager = cache.getRegionManager();
EvictionPolicyConfig config = new DummyEvictionConfiguration();
regionManager.setUsingEvictions(true);
- regionManager.getRegion(RegionManager.DEFAULT_REGION, true).setEvictionPolicy(config);
+ regionManager.getRegion(Fqn.ROOT, true).setEvictionPolicy(config);
regionManager.getRegion("/a/b/c", true).setEvictionPolicy(config);
regionManager.getRegion("/a/b/c/d", true).setEvictionPolicy(config);
@@ -65,10 +69,6 @@
regionManager.getRegion("/d/e/g", true).setEvictionPolicy(config);
regionManager.getRegion("/d/e", true).setEvictionPolicy(config);
- cache = (CacheSPI<Object, Object>) DefaultCacheFactory.getInstance().createCache(false);
- cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
- cache.getConfiguration().setIsolationLevel(IsolationLevel.SERIALIZABLE);
-
// make the interceptor chain (separate from the CacheSPI object.
interceptor = new CacheMgmtInterceptor();
@@ -272,18 +272,19 @@
assertNull(region.takeLastEventNode());
+ // What exactly are we trying to test here?!?
// check null handling
- mc = MethodCallFactory.create(MethodDeclarations.getKeyValueMethodLocal, key, true);
- interceptor.invoke(InvocationContext.fromMethodCall(mc));
- assertNull(region.takeLastEventNode());
-
- mc = MethodCallFactory.create(MethodDeclarations.getKeyValueMethodLocal, null, true);
- interceptor.invoke(InvocationContext.fromMethodCall(mc));
- assertNull(region.takeLastEventNode());
-
- mc = MethodCallFactory.create(MethodDeclarations.getKeyValueMethodLocal, fqn, null, true);
- interceptor.invoke(InvocationContext.fromMethodCall(mc));
- assertNull(region.takeLastEventNode());
+// mc = MethodCallFactory.create(MethodDeclarations.getKeyValueMethodLocal, fqn, key, true);
+// interceptor.invoke(InvocationContext.fromMethodCall(mc));
+// assertNull(region.takeLastEventNode());
+//
+// mc = MethodCallFactory.create(MethodDeclarations.getKeyValueMethodLocal, fqn, null, true);
+// interceptor.invoke(InvocationContext.fromMethodCall(mc));
+// assertNull(region.takeLastEventNode());
+//
+// mc = MethodCallFactory.create(MethodDeclarations.getKeyValueMethodLocal, fqn, null, true);
+// interceptor.invoke(InvocationContext.fromMethodCall(mc));
+// assertNull(region.takeLastEventNode());
}
public void testCreateNode() throws Throwable
@@ -297,7 +298,7 @@
// this region is node granularity
Fqn fqn = Fqn.fromString("/a/b/c");
- MethodCall mc = MethodCallFactory.create(MethodDeclarations.putDataMethodLocal, fqn, data, false);
+ MethodCall mc = MethodCallFactory.create(MethodDeclarations.putDataMethodLocal, null, fqn, data, false);
interceptor.invoke(InvocationContext.fromMethodCall(mc));
Region region = regionManager.getRegion(fqn.toString(), false);
@@ -318,7 +319,7 @@
for (int i = 0; i < 100; i++)
{
- mc = MethodCallFactory.create(MethodDeclarations.putKeyValMethodLocal, fqn, i,
+ mc = MethodCallFactory.create(MethodDeclarations.putKeyValMethodLocal, null, fqn, i,
"value", false);
interceptor.invoke(InvocationContext.fromMethodCall(mc));
@@ -336,7 +337,7 @@
assertNull(region.takeLastEventNode());
fqn = Fqn.fromString("/a/b");
- mc = MethodCallFactory.create(MethodDeclarations.putDataEraseMethodLocal, fqn, data, false, false);
+ mc = MethodCallFactory.create(MethodDeclarations.putDataEraseMethodLocal, null, fqn, data, false, false);
interceptor.invoke(InvocationContext.fromMethodCall(mc));
event = regionManager.getRegion(fqn.toString(), false).takeLastEventNode();
assertFalse(event.isResetElementCount());
@@ -355,7 +356,7 @@
assertEquals(i, node.get(i));
}
- mc = MethodCallFactory.create(MethodDeclarations.putDataEraseMethodLocal, fqn, data, false, true);
+ mc = MethodCallFactory.create(MethodDeclarations.putDataEraseMethodLocal, null, fqn, data, false, true);
interceptor.invoke(InvocationContext.fromMethodCall(mc));
event = regionManager.getRegion(fqn.toString(), false).takeLastEventNode();
assertEquals(NodeEventType.ADD_NODE_EVENT, event.getEventType());
@@ -385,7 +386,7 @@
Object value = "value";
MethodCall mc = MethodCallFactory.create(MethodDeclarations.putKeyValMethodLocal,
- fqn, key, value, false);
+ null, fqn, key, value, false);
interceptor.invoke(InvocationContext.fromMethodCall(mc));
assertEquals("value", cache.get(fqn, key));
EvictedEventNode event = region.takeLastEventNode();
@@ -396,7 +397,7 @@
assertNull(region.takeLastEventNode());
mc = MethodCallFactory.create(MethodDeclarations.putKeyValMethodLocal,
- fqn, key, value, false);
+ null, fqn, key, value, false);
interceptor.invoke(InvocationContext.fromMethodCall(mc));
assertEquals("value", cache.get(fqn, key));
event = region.takeLastEventNode();
@@ -414,7 +415,7 @@
cache.put(fqn, "a", "b");
cache.put(fqn, "b", "c");
- MethodCall mc = MethodCallFactory.create(MethodDeclarations.removeDataMethodLocal, fqn, false);
+ MethodCall mc = MethodCallFactory.create(MethodDeclarations.removeDataMethodLocal, null, fqn, false);
interceptor.invoke(InvocationContext.fromMethodCall(mc));
assertEquals(0, cache.getNode(fqn).getData().size());
@@ -424,7 +425,7 @@
assertEquals(fqn, event.getFqn());
assertNull(region.takeLastEventNode());
- mc = MethodCallFactory.create(MethodDeclarations.removeNodeMethodLocal, fqn, false);
+ mc = MethodCallFactory.create(MethodDeclarations.removeNodeMethodLocal, null, fqn, false);
interceptor.invoke(InvocationContext.fromMethodCall(mc));
assertNull(cache.getNode(fqn));
@@ -441,7 +442,7 @@
cache.put(fqn, "b", "c");
MethodCall mc = MethodCallFactory.create(MethodDeclarations.removeKeyMethodLocal,
- fqn, "a", false);
+ null, fqn, "a", false);
interceptor.invoke(InvocationContext.fromMethodCall(mc));
assertNull(cache.get(fqn, "a"));
@@ -453,7 +454,7 @@
assertNull(region.takeLastEventNode());
mc = MethodCallFactory.create(MethodDeclarations.removeKeyMethodLocal,
- fqn, "b", false);
+ null, fqn, "b", false);
interceptor.invoke(InvocationContext.fromMethodCall(mc));
assertNull(cache.get(fqn, "b"));
@@ -464,7 +465,7 @@
assertNull(region.takeLastEventNode());
mc = MethodCallFactory.create(MethodDeclarations.removeKeyMethodLocal,
- fqn, "b", false);
+ null, fqn, "b", false);
interceptor.invoke(InvocationContext.fromMethodCall(mc));
event = region.takeLastEventNode();
@@ -482,7 +483,7 @@
// this region is node granularity
Fqn fqn = Fqn.fromString("/a/b/c");
- MethodCall mc = MethodCallFactory.create(MethodDeclarations.putDataMethodLocal, fqn, data, false);
+ MethodCall mc = MethodCallFactory.create(MethodDeclarations.putDataMethodLocal, null, fqn, data, false);
interceptor.invoke(InvocationContext.fromMethodCall(mc));
Region region = regionManager.getRegion(fqn.toString(), false);
@@ -501,7 +502,7 @@
assertEquals(fqn, event.getFqn());
assertNull(region.takeLastEventNode());
- mc = MethodCallFactory.create(MethodDeclarations.removeNodeMethodLocal, fqn, false);
+ mc = MethodCallFactory.create(MethodDeclarations.removeNodeMethodLocal, null, fqn, false);
interceptor.invoke(InvocationContext.fromMethodCall(mc));
assertNull(cache.getNode(fqn));
event = region.takeLastEventNode();
@@ -512,7 +513,7 @@
Object key = "key";
Object value = "value";
mc = MethodCallFactory.create(MethodDeclarations.putKeyValMethodLocal,
- fqn, key, value, false);
+ null, fqn, key, value, false);
interceptor.invoke(InvocationContext.fromMethodCall(mc));
assertEquals("value", cache.get(fqn, key));
event = region.takeLastEventNode();
@@ -531,7 +532,7 @@
assertNull(region.takeLastEventNode());
mc = MethodCallFactory.create(MethodDeclarations.removeKeyMethodLocal,
- fqn, key, false);
+ null, fqn, key, false);
interceptor.invoke(InvocationContext.fromMethodCall(mc));
assertNull(cache.get(fqn, key));
16 years, 4 months
JBoss Cache SVN: r4854 - in core/trunk/src: main/java/org/jboss/cache/config and 7 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2007-12-13 18:54:19 -0500 (Thu, 13 Dec 2007)
New Revision: 4854
Modified:
core/trunk/src/main/java/org/jboss/cache/RegionManager.java
core/trunk/src/main/java/org/jboss/cache/config/ConfigurationComponent.java
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java
core/trunk/src/main/java/org/jboss/cache/invocation/AbstractInvocationDelegate.java
core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java
core/trunk/src/main/java/org/jboss/cache/loader/CacheLoaderManager.java
core/trunk/src/main/java/org/jboss/cache/transaction/TransactionEntry.java
core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java
core/trunk/src/test/java/org/jboss/cache/loader/CacheLoaderManagerTest.java
core/trunk/src/test/java/org/jboss/cache/loader/CacheLoaderWithReplicationTest.java
core/trunk/src/test/java/org/jboss/cache/marshall/ActiveInactiveTest.java
Log:
more fixes
Modified: core/trunk/src/main/java/org/jboss/cache/RegionManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/RegionManager.java 2007-12-13 22:47:36 UTC (rev 4853)
+++ core/trunk/src/main/java/org/jboss/cache/RegionManager.java 2007-12-13 23:54:19 UTC (rev 4854)
@@ -92,8 +92,8 @@
}
setDefaultInactive(configuration.isInactiveOnStartup());
- if (log.isTraceEnabled())
- log.trace("Finished region manager. Default region is " + regionsRegistry.get(Fqn.ROOT));
+
+ if (defaultInactive) regionsRegistry.get(Fqn.ROOT).setActive(false);
}
@Stop
@@ -124,6 +124,8 @@
public void setDefaultInactive(boolean defaultInactive)
{
this.defaultInactive = defaultInactive;
+ Region defaultRegion = regionsRegistry.get(Fqn.ROOT);
+ if (defaultRegion != null) defaultRegion.setActive(!defaultInactive);
}
/**
@@ -360,6 +362,16 @@
{
throw new RuntimeException(e);
}
+
+// if (!fqn.isRoot())
+// {
+// // activate parent regions
+// Region parent = getRegion(fqn.getParent(), false);
+// if (parent != null && !parent.isActive())
+// {
+// activate(parent.getFqn(), suppressRegionNotEmptyException);
+// }
+// }
}
/**
Modified: core/trunk/src/main/java/org/jboss/cache/config/ConfigurationComponent.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/ConfigurationComponent.java 2007-12-13 22:47:36 UTC (rev 4853)
+++ core/trunk/src/main/java/org/jboss/cache/config/ConfigurationComponent.java 2007-12-13 23:54:19 UTC (rev 4854)
@@ -101,7 +101,7 @@
{
try
{
- if (cache != null && (cache.getCacheStatus() == CacheStatus.STARTED || cache.getCacheStatus() == CacheStatus.STARTING) && !getClass().getDeclaredField(fieldName).isAnnotationPresent(Dynamic.class))
+ if (cache != null && cache.getCacheStatus() != null && (cache.getCacheStatus() == CacheStatus.STARTED || cache.getCacheStatus() == CacheStatus.STARTING) && !getClass().getDeclaredField(fieldName).isAnnotationPresent(Dynamic.class))
{
throw new ConfigurationException("Attempted to modify a non-Dynamic configuration element [" + fieldName + "] after the cache has started!");
}
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java 2007-12-13 22:47:36 UTC (rev 4853)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java 2007-12-13 23:54:19 UTC (rev 4854)
@@ -1,5 +1,6 @@
package org.jboss.cache.interceptors;
+import org.apache.commons.logging.Log;
import org.jboss.cache.CacheException;
import org.jboss.cache.CacheSPI;
import org.jboss.cache.Fqn;
@@ -14,10 +15,9 @@
import org.jboss.cache.transaction.TransactionEntry;
import org.jboss.cache.transaction.TransactionTable;
import org.jgroups.Address;
-import org.apache.commons.logging.Log;
+import javax.transaction.SystemException;
import javax.transaction.TransactionManager;
-import javax.transaction.SystemException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
@@ -59,8 +59,15 @@
this.loader = cache.getCacheLoaderManager().getCacheLoader();
}
+ public Object invoke(InvocationContext ctx) throws Throwable
+ {
+ if (loaderConfig == null) loaderConfig = cache.getCacheLoaderManager().getCacheLoaderConfig();
+ if (loader == null) loader = cache.getCacheLoaderManager().getCacheLoader();
+ return super.invoke(ctx);
+ }
+
/**
- * if this is a shared cache loader and the call is of remote origin, pass up the chain
+ * if this is a shared cache loader and the call is of remote origin, pass up the chain
*/
protected boolean skipMethodCall(InvocationContext ctx)
{
@@ -113,7 +120,8 @@
storeInternalState(affectedFqns);
}
return returnValue;
- } else
+ }
+ else
{
log.trace("Commit called with no modifications; ignoring.");
}
@@ -229,7 +237,8 @@
protected Object handlePutDataEraseMethod(InvocationContext ctx, GlobalTransaction gt, Fqn fqn, Map newData, boolean createUndoOps, boolean eraseContents) throws Throwable
{
Object returnValue = nextInterceptor(ctx);
- if (inTransaction()) {
+ if (inTransaction())
+ {
return returnValue;
}
loader.removeData(fqn);
@@ -265,7 +274,7 @@
}
private Object handlePutKeyValue(InvocationContext ctx, Fqn fqn, Object key, Object value)
- throws Throwable
+ throws Throwable
{
Object returnValue = nextInterceptor(ctx);
if (inTransaction())
@@ -364,8 +373,8 @@
if (configuration.getExposeManagementStatistics() && getStatisticsEnabled())
{
if ((mod.getType() == Modification.ModificationType.PUT_DATA) ||
- (mod.getType() == Modification.ModificationType.PUT_DATA_ERASE) ||
- (mod.getType() == Modification.ModificationType.PUT_KEY_VALUE))
+ (mod.getType() == Modification.ModificationType.PUT_DATA_ERASE) ||
+ (mod.getType() == Modification.ModificationType.PUT_KEY_VALUE))
{
txPuts++;
}
@@ -390,7 +399,6 @@
/**
* Converts a method call to a Modification, to be sent to a cache loader. In addition, adds any affected Fqns to the
* affectedFqns collection, which is then used by the calling code.
- *
*/
private Modification convertMethodCallToModification(MethodCall methodCall, Set<Fqn> affectedFqns) throws Exception
{
@@ -410,27 +418,27 @@
{
case MethodDeclarations.putDataMethodLocal_id:
mod = new Modification(Modification.ModificationType.PUT_DATA,
- fqn, (Map) args[2]);// data
+ fqn, (Map) args[2]);// data
break;
case MethodDeclarations.putDataEraseMethodLocal_id:
mod = new Modification(Modification.ModificationType.PUT_DATA_ERASE,
- fqn, (Map) args[2]);// data
+ fqn, (Map) args[2]);// data
break;
case MethodDeclarations.putKeyValMethodLocal_id:
mod = new Modification(Modification.ModificationType.PUT_KEY_VALUE,
- fqn, args[2], args[3]);// key + value
+ fqn, args[2], args[3]);// key + value
break;
case MethodDeclarations.removeNodeMethodLocal_id:
mod = new Modification(Modification.ModificationType.REMOVE_NODE,
- fqn);
+ fqn);
break;
case MethodDeclarations.removeKeyMethodLocal_id:
mod = new Modification(Modification.ModificationType.REMOVE_KEY_VALUE,
- fqn, args[2]);// key
+ fqn, args[2]);// key
break;
case MethodDeclarations.removeDataMethodLocal_id:
mod = new Modification(Modification.ModificationType.REMOVE_DATA,
- fqn);
+ fqn);
break;
case MethodDeclarations.moveMethodLocal_id:
Fqn moveFrom = (Fqn) args[0];
Modified: core/trunk/src/main/java/org/jboss/cache/invocation/AbstractInvocationDelegate.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/invocation/AbstractInvocationDelegate.java 2007-12-13 22:47:36 UTC (rev 4853)
+++ core/trunk/src/main/java/org/jboss/cache/invocation/AbstractInvocationDelegate.java 2007-12-13 23:54:19 UTC (rev 4854)
@@ -138,6 +138,7 @@
{
if (!originLocal) ctx.setOriginLocal(true);
// reset old method call
+ if (ctx == null) ctx = invocationContextContainer.get();
ctx.setMethodCall(oldCall);
}
}
Modified: core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java 2007-12-13 22:47:36 UTC (rev 4853)
+++ core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java 2007-12-13 23:54:19 UTC (rev 4854)
@@ -264,7 +264,7 @@
public CacheStatus getCacheStatus()
{
- return cache.getCacheStatus();
+ return cache == null ? null : cache.getCacheStatus();
}
public InvocationContext getInvocationContext()
@@ -572,7 +572,7 @@
return getChildrenNames(Fqn.fromString(fqn));
}
- public CacheImpl getImpl()
+ public CacheImpl getDelegationTarget()
{
return cache;
}
Modified: core/trunk/src/main/java/org/jboss/cache/loader/CacheLoaderManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/CacheLoaderManager.java 2007-12-13 22:47:36 UTC (rev 4853)
+++ core/trunk/src/main/java/org/jboss/cache/loader/CacheLoaderManager.java 2007-12-13 23:54:19 UTC (rev 4854)
@@ -14,6 +14,7 @@
import org.jboss.cache.config.CacheLoaderConfig;
import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig.SingletonStoreConfig;
+import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.factories.annotations.Start;
import org.jboss.cache.factories.annotations.Stop;
@@ -66,6 +67,7 @@
private CacheSPI cache;
private CacheLoader loader;
private boolean fetchPersistentState;
+ private Configuration configuration;
/**
* Sets a configuration object and creates a cacheloader accordingly.
@@ -75,10 +77,12 @@
* @throws CacheException
*/
@Inject
- public void setConfig(CacheLoaderConfig config, CacheSPI cache) throws CacheException
+ public void setConfig(CacheLoaderConfig config, CacheSPI cache, Configuration configuration) throws CacheException
{
this.config = config == null ? new CacheLoaderConfig() : config;
this.cache = cache;
+ this.configuration = configuration;
+
if (config != null)
{
try
@@ -220,7 +224,7 @@
// startCacheLoader() method.
// tmpLoader.create();
// tmpLoader.start();
- if (cache != null && cache.getConfiguration().isUseRegionBasedMarshalling())
+ if (configuration != null && configuration.isUseRegionBasedMarshalling())
{
tmpLoader.setRegionManager(cache.getRegionManager());
}
Modified: core/trunk/src/main/java/org/jboss/cache/transaction/TransactionEntry.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/transaction/TransactionEntry.java 2007-12-13 22:47:36 UTC (rev 4853)
+++ core/trunk/src/main/java/org/jboss/cache/transaction/TransactionEntry.java 2007-12-13 23:54:19 UTC (rev 4854)
@@ -340,7 +340,7 @@
{
l = new ArrayList<MethodCall>(undo_list);
}
- CacheImpl ci = ((CacheInvocationDelegate) cache).getImpl();
+ CacheImpl ci = ((CacheInvocationDelegate) cache).getDelegationTarget();
for (ListIterator<MethodCall> i = l.listIterator(l.size()); i.hasPrevious();)
{
MethodCall undo_op = i.previous();
Modified: core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java 2007-12-13 22:47:36 UTC (rev 4853)
+++ core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java 2007-12-13 23:54:19 UTC (rev 4854)
@@ -4,6 +4,7 @@
import org.jboss.cache.CacheImpl;
import org.jboss.cache.CacheSPI;
import org.jboss.cache.interceptors.Interceptor;
+import org.jboss.cache.invocation.CacheInvocationDelegate;
/**
* Helper that prints the contents of a {@link org.jboss.cache.Cache} to a string.
@@ -35,7 +36,7 @@
public static String printCacheLockingInfo(Cache c)
{
// internal cast
- CacheImpl ci = (CacheImpl) c;
+ CacheImpl ci = ((CacheInvocationDelegate) c).getDelegationTarget();
return ci.printLockInfo();
}
Modified: core/trunk/src/test/java/org/jboss/cache/loader/CacheLoaderManagerTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/CacheLoaderManagerTest.java 2007-12-13 22:47:36 UTC (rev 4853)
+++ core/trunk/src/test/java/org/jboss/cache/loader/CacheLoaderManagerTest.java 2007-12-13 23:54:19 UTC (rev 4854)
@@ -64,7 +64,7 @@
CacheLoaderConfig cfg = createCacheLoaderCfg(false);
cfg.addIndividualCacheLoaderConfig(createIndividualCacheLoaderConfig(cfg, false, "org.jboss.cache.loader.FileCacheLoader"));
- mgr.setConfig(cfg, null);
+ mgr.setConfig(cfg, null, null);
CacheLoader cl = mgr.getCacheLoader();
assertEquals(FileCacheLoader.class, cl.getClass());
@@ -73,7 +73,7 @@
cfg = createCacheLoaderCfg(false);
cfg.addIndividualCacheLoaderConfig(createIndividualCacheLoaderConfig(cfg, true, "org.jboss.cache.loader.FileCacheLoader"));
- mgr.setConfig(cfg, null);
+ mgr.setConfig(cfg, null, null);
cl = mgr.getCacheLoader();
assertEquals(AsyncCacheLoader.class, cl.getClass());
@@ -88,7 +88,7 @@
cfg.addIndividualCacheLoaderConfig(createIndividualCacheLoaderConfig(cfg, false, "org.jboss.cache.loader.JDBCCacheLoader"));
CacheLoaderManager mgr = new CacheLoaderManager();
- mgr.setConfig(cfg, null);
+ mgr.setConfig(cfg, null, null);
CacheLoader cl = mgr.getCacheLoader();
assertEquals(FileCacheLoader.class, cl.getClass());
@@ -99,7 +99,7 @@
cfg.addIndividualCacheLoaderConfig(createIndividualCacheLoaderConfig(cfg, true, "org.jboss.cache.loader.bdbje.BdbjeCacheLoader"));
cfg.addIndividualCacheLoaderConfig(createIndividualCacheLoaderConfig(cfg, true, "org.jboss.cache.loader.JDBCCacheLoader"));
- mgr.setConfig(cfg, null);
+ mgr.setConfig(cfg, null, null);
cl = mgr.getCacheLoader();
assertEquals(AsyncCacheLoader.class, cl.getClass());
@@ -111,7 +111,7 @@
CacheLoaderConfig clc = getSingleCacheLoaderConfig("", "org.jboss.cache.loader.FileCacheLoader", "location=" + getTempDir(), false, false, false);
CacheLoaderManager mgr = new CacheLoaderManager();
- mgr.setConfig(clc, null);
+ mgr.setConfig(clc, null, null);
CacheLoader cl = mgr.getCacheLoader();
assertEquals(FileCacheLoader.class, cl.getClass());
@@ -119,7 +119,7 @@
// with async
clc = getSingleCacheLoaderConfig("", "org.jboss.cache.loader.FileCacheLoader", "location=" + getTempDir(), true, false, false);
- mgr.setConfig(clc, null);
+ mgr.setConfig(clc, null, null);
cl = mgr.getCacheLoader();
assertEquals(AsyncCacheLoader.class, cl.getClass());
}
@@ -158,7 +158,7 @@
"</cacheloader></config>";
CacheLoaderConfig clc = XmlConfigurationParser.parseCacheLoaderConfig(strToElement(conf));
CacheLoaderManager mgr = new CacheLoaderManager();
- mgr.setConfig(clc, null);
+ mgr.setConfig(clc, null, null);
CacheLoader cl = mgr.getCacheLoader();
assertEquals(FileCacheLoader.class, cl.getClass());
@@ -193,7 +193,7 @@
" </properties>" +
"</cacheloader></config>";
clc = XmlConfigurationParser.parseCacheLoaderConfig(strToElement(conf));
- mgr.setConfig(clc, null);
+ mgr.setConfig(clc, null, null);
cl = mgr.getCacheLoader();
assertEquals(AsyncCacheLoader.class, cl.getClass());
@@ -207,7 +207,7 @@
cfg.addIndividualCacheLoaderConfig(createIndividualCacheLoaderConfig(cfg, false, "org.jboss.cache.loader.JDBCCacheLoader"));
CacheLoaderManager mgr = new CacheLoaderManager();
- mgr.setConfig(cfg, null);
+ mgr.setConfig(cfg, null, null);
CacheLoader cl = mgr.getCacheLoader();
assertEquals(ChainingCacheLoader.class, cl.getClass());
@@ -221,7 +221,7 @@
cfg.addIndividualCacheLoaderConfig(createIndividualCacheLoaderConfig(cfg, false, "org.jboss.cache.loader.FileCacheLoader"));
cfg.addIndividualCacheLoaderConfig(createIndividualCacheLoaderConfig(cfg, true, "org.jboss.cache.loader.JDBCCacheLoader"));
- mgr.setConfig(cfg, null);
+ mgr.setConfig(cfg, null, null);
cl = mgr.getCacheLoader();
assertEquals(ChainingCacheLoader.class, cl.getClass());
@@ -256,7 +256,7 @@
CacheLoaderConfig clc = XmlConfigurationParser.parseCacheLoaderConfig(strToElement(conf));
CacheLoaderManager mgr = new CacheLoaderManager();
- mgr.setConfig(clc, null);
+ mgr.setConfig(clc, null, null);
CacheLoader cl = mgr.getCacheLoader();
@@ -288,7 +288,7 @@
" </properties>" +
"</cacheloader></config>";
clc = XmlConfigurationParser.parseCacheLoaderConfig(strToElement(conf));
- mgr.setConfig(clc, null);
+ mgr.setConfig(clc, null, null);
cl = mgr.getCacheLoader();
assertEquals(ChainingCacheLoader.class, cl.getClass());
@@ -314,7 +314,7 @@
try
{
- mgr.setConfig(cfg, null);
+ mgr.setConfig(cfg, null, null);
assertTrue("Should throw exception since we have > 1 cache loader with fetchPersistentState as true", false);
}
catch (Exception e)
@@ -331,7 +331,7 @@
cfg.addIndividualCacheLoaderConfig(i);
assertEquals(1, cfg.getIndividualCacheLoaderConfigs().size());
- mgr.setConfig(cfg, null);
+ mgr.setConfig(cfg, null, null);
// control cases which should not throw exceptions
mgr = new CacheLoaderManager();
@@ -345,7 +345,7 @@
cfg.addIndividualCacheLoaderConfig(i2);
assertEquals(2, cfg.getIndividualCacheLoaderConfigs().size());
- mgr.setConfig(cfg, null);
+ mgr.setConfig(cfg, null, null);
// control cases which should not throw exceptions
mgr = new CacheLoaderManager();
@@ -359,7 +359,7 @@
cfg.addIndividualCacheLoaderConfig(i2);
assertEquals(2, cfg.getIndividualCacheLoaderConfigs().size());
- mgr.setConfig(cfg, null);
+ mgr.setConfig(cfg, null, null);
}
public void testConfigurationParsing() throws Exception
@@ -388,7 +388,7 @@
"</cacheloader></config>";
CacheLoaderConfig clc = XmlConfigurationParser.parseCacheLoaderConfig(strToElement(conf));
CacheLoaderManager mgr = new CacheLoaderManager();
- mgr.setConfig(clc, null);
+ mgr.setConfig(clc, null, null);
assertEquals(ChainingCacheLoader.class, mgr.getCacheLoader().getClass());
assertTrue("Should be true", mgr.isFetchPersistentState());
@@ -437,7 +437,7 @@
clc = XmlConfigurationParser.parseCacheLoaderConfig(strToElement(conf));
mgr = new CacheLoaderManager();
- mgr.setConfig(clc, null);
+ mgr.setConfig(clc, null, null);
assertTrue("Should be false", !mgr.isFetchPersistentState());
@@ -461,7 +461,7 @@
"</config>";
CacheLoaderConfig clc = XmlConfigurationParser.parseCacheLoaderConfig(strToElement(conf));
CacheLoaderManager mgr = new CacheLoaderManager();
- mgr.setConfig(clc, null);
+ mgr.setConfig(clc, null, null);
CacheLoaderConfig.IndividualCacheLoaderConfig iclc = mgr.getCacheLoaderConfig().getFirstCacheLoaderConfig();
assertNull("Singleton has not been configured", iclc.getSingletonStoreConfig());
@@ -486,7 +486,7 @@
"</config>";
clc = XmlConfigurationParser.parseCacheLoaderConfig(strToElement(conf));
mgr = new MockCacheLoaderManager();
- mgr.setConfig(clc, null);
+ mgr.setConfig(clc, null, null);
iclc = mgr.getCacheLoaderConfig().getFirstCacheLoaderConfig();
assertNotNull("Singleton has been configured", iclc.getSingletonStoreConfig());
@@ -512,7 +512,7 @@
"</config>";
clc = XmlConfigurationParser.parseCacheLoaderConfig(strToElement(conf));
mgr = new MockCacheLoaderManager();
- mgr.setConfig(clc, null);
+ mgr.setConfig(clc, null, null);
iclc = mgr.getCacheLoaderConfig().getFirstCacheLoaderConfig();
assertNotNull("Singleton has been configured", iclc.getSingletonStoreConfig());
@@ -545,7 +545,7 @@
"</config>";
clc = XmlConfigurationParser.parseCacheLoaderConfig(strToElement(conf));
mgr = new CacheLoaderManager();
- mgr.setConfig(clc, null);
+ mgr.setConfig(clc, null, null);
iclc = mgr.getCacheLoaderConfig().getFirstCacheLoaderConfig();
assertNotNull("Singleton has been configured", iclc.getSingletonStoreConfig());
@@ -576,7 +576,7 @@
"</config>";
clc = XmlConfigurationParser.parseCacheLoaderConfig(strToElement(conf));
mgr = new CacheLoaderManager();
- mgr.setConfig(clc, null);
+ mgr.setConfig(clc, null, null);
iclc = mgr.getCacheLoaderConfig().getFirstCacheLoaderConfig();
assertNotNull("Singleton has been configured", iclc.getSingletonStoreConfig());
@@ -603,7 +603,7 @@
"</config>";
clc = XmlConfigurationParser.parseCacheLoaderConfig(strToElement(conf));
mgr = new MockCacheLoaderManager();
- mgr.setConfig(clc, null);
+ mgr.setConfig(clc, null, null);
iclc = mgr.getCacheLoaderConfig().getFirstCacheLoaderConfig();
assertNotNull("Singleton has been configured", iclc.getSingletonStoreConfig());
@@ -636,7 +636,7 @@
"</config>";
clc = XmlConfigurationParser.parseCacheLoaderConfig(strToElement(conf));
mgr = new MockCacheLoaderManager();
- mgr.setConfig(clc, null);
+ mgr.setConfig(clc, null, null);
iclc = mgr.getCacheLoaderConfig().getFirstCacheLoaderConfig();
assertNotNull("Singleton has been configured", iclc.getSingletonStoreConfig());
@@ -670,7 +670,7 @@
"</config>";
clc = XmlConfigurationParser.parseCacheLoaderConfig(strToElement(conf));
mgr = new MockCacheLoaderManager();
- mgr.setConfig(clc, null);
+ mgr.setConfig(clc, null, null);
iclc = mgr.getCacheLoaderConfig().getFirstCacheLoaderConfig();
assertNotNull("Singleton has been configured", iclc.getSingletonStoreConfig());
@@ -704,7 +704,7 @@
mgr = new CacheLoaderManager();
try
{
- mgr.setConfig(clc, null);
+ mgr.setConfig(clc, null, null);
fail("A cache loader cannot be configured as singleton and shared, should have thrown an Exception");
}
catch (Exception e)
@@ -735,7 +735,7 @@
try
{
- mgr.setConfig(clc, null);
+ mgr.setConfig(clc, null, null);
fail("A singleton store class implementation must extend AbstractDelegatingCacheLoader");
}
catch (Exception e)
Modified: core/trunk/src/test/java/org/jboss/cache/loader/CacheLoaderWithReplicationTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/CacheLoaderWithReplicationTest.java 2007-12-13 22:47:36 UTC (rev 4853)
+++ core/trunk/src/test/java/org/jboss/cache/loader/CacheLoaderWithReplicationTest.java 2007-12-13 23:54:19 UTC (rev 4854)
@@ -6,10 +6,7 @@
*/
package org.jboss.cache.loader;
-import javax.transaction.TransactionManager;
-
import junit.framework.Assert;
-
import org.jboss.cache.Cache;
import org.jboss.cache.CacheSPI;
import org.jboss.cache.DefaultCacheFactory;
@@ -18,12 +15,16 @@
import org.jboss.cache.misc.TestingUtil;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+import javax.transaction.TransactionManager;
+
/**
* Tests using cache loaders with replicating data
*
* @author <a href="mailto:manik@jboss.org">Manik Surtani (manik(a)jboss.org)</a>
*/
+@Test(groups = "functional")
public class CacheLoaderWithReplicationTest extends AbstractCacheLoaderTestBase
{
private Cache<Object, Object> cache1, cache2;
Modified: core/trunk/src/test/java/org/jboss/cache/marshall/ActiveInactiveTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/marshall/ActiveInactiveTest.java 2007-12-13 22:47:36 UTC (rev 4853)
+++ core/trunk/src/test/java/org/jboss/cache/marshall/ActiveInactiveTest.java 2007-12-13 23:54:19 UTC (rev 4854)
@@ -154,7 +154,7 @@
public void testObjectFromByteBuffer() throws Exception
{
MethodCall put = MethodCallFactory.create(MethodDeclarations.putKeyValMethodLocal,
- A_B, "name", "Joe", false);
+ null, A_B, "name", "Joe", false);
MethodCall replicate = MethodCallFactory.create(MethodDeclarations.replicateMethod, put);
16 years, 4 months
JBoss Cache SVN: r4853 - core/branches/1.4.X/tests/functional/org/jboss/cache/aop/loader.
by jbosscache-commits@lists.jboss.org
Author: galder.zamarreno(a)jboss.com
Date: 2007-12-13 17:47:36 -0500 (Thu, 13 Dec 2007)
New Revision: 4853
Modified:
core/branches/1.4.X/tests/functional/org/jboss/cache/aop/loader/FileCacheLoaderAopCollectionsTest.java
Log:
[00019737] Two test methods added. The latter replicates the issue the customer is seeing in this support case, where removal operations on collections loaded from cache loader mess up other instances in collection. The first test method does the removal of a collection in memory which works fine.
Modified: core/branches/1.4.X/tests/functional/org/jboss/cache/aop/loader/FileCacheLoaderAopCollectionsTest.java
===================================================================
--- core/branches/1.4.X/tests/functional/org/jboss/cache/aop/loader/FileCacheLoaderAopCollectionsTest.java 2007-12-13 22:39:01 UTC (rev 4852)
+++ core/branches/1.4.X/tests/functional/org/jboss/cache/aop/loader/FileCacheLoaderAopCollectionsTest.java 2007-12-13 22:47:36 UTC (rev 4853)
@@ -8,35 +8,40 @@
import org.w3c.dom.Element;
import org.jboss.cache.xml.XmlHelper;
+import org.jboss.cache.aop.test.Address;
+import org.jboss.cache.aop.test.Person;
import junit.framework.Test;
import junit.framework.TestSuite;
+import java.util.List;
+import java.util.ArrayList;
+
/**
*/
-public class FileCacheLoaderAopCollectionsTest extends CacheLoaderTestsBase {
+public class FileCacheLoaderAopCollectionsTest extends CacheLoaderTestsBase
+{
+ protected Element getCacheLoaderConfig(String loc) throws Exception
+ {
+ String xml = " <config>\n" +
+ " \n" +
+ " <passivation>false</passivation>\n" +
+ " <preload></preload>\n" +
+ "\n" +
+ " <cacheloader>\n" +
+ " <class>org.jboss.cache.loader.FileCacheLoader</class>\n" +
+ " <properties>\n" +
+ " location=" + loc + "\n" +
+ " </properties>\n" +
+ " <async>false</async>\n" +
+ " <fetchPersistentState>false</fetchPersistentState>\n" +
+ " <ignoreModifications>false</ignoreModifications>\n" +
+ " </cacheloader>\n" +
+ " \n" +
+ " </config>";
+ return XmlHelper.stringToElement(xml);
+ }
- protected Element getCacheLoaderConfig(String loc) throws Exception
- {
- String xml = " <config>\n" +
- " \n" +
- " <passivation>false</passivation>\n" +
- " <preload></preload>\n" +
- "\n" +
- " <cacheloader>\n" +
- " <class>org.jboss.cache.loader.FileCacheLoader</class>\n" +
- " <properties>\n" +
- " location=" + loc + "\n" +
- " </properties>\n" +
- " <async>false</async>\n" +
- " <fetchPersistentState>false</fetchPersistentState>\n" +
- " <ignoreModifications>false</ignoreModifications>\n" +
- " </cacheloader>\n" +
- " \n" +
- " </config>";
- return XmlHelper.stringToElement(xml);
- }
-
protected void configureCache() throws Exception {
String tmp_location = System.getProperty("java.io.tmpdir", "c:\\tmp");
cache.setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.FileCacheLoader", "", false, true, false));
@@ -65,4 +70,75 @@
{
}
+ public void testPojoCollectionRemove() throws Exception
+ {
+ String fqn = "/list";
+
+ Person brian = new Person(); // instantiate a Person object named joe
+ brian.setName("Brian");
+
+ Person manik = new Person(); // instantiate a Person object named joe
+ manik.setName("Manik");
+
+ List list = new ArrayList();
+ list.add(brian);
+ list.add(manik);
+
+ cache.putObject(fqn, list);
+
+ List proxyList = (List) cache.getObject(fqn);
+
+ brian = (Person)proxyList.get(0);
+ assertEquals("Brian", brian.getName());
+ manik = (Person)proxyList.get(1);
+ assertEquals("Manik", manik.getName());
+
+ proxyList.remove(0);
+
+ manik = (Person)proxyList.get(0);
+ assertEquals("Manik", manik.getName());
+ }
+
+ public void testPojoCollectionLoadAndRemoveAfterRestart() throws Exception
+ {
+ String fqn = "/list";
+
+ Person brian = new Person(); // instantiate a Person object named joe
+ brian.setName("Brian");
+
+ Person manik = new Person(); // instantiate a Person object named joe
+ manik.setName("Manik");
+
+ Person bela = new Person(); // instantiate a Person object named joe
+ bela.setName("Bela");
+
+ List list = new ArrayList();
+ list.add(brian);
+ list.add(manik);
+
+ cache.putObject(fqn, list);
+
+ List proxyList = (List) cache.getObject(fqn);
+
+ brian = (Person)proxyList.get(0);
+ assertEquals("Brian", brian.getName());
+ manik = (Person)proxyList.get(1);
+ assertEquals("Manik", manik.getName());
+
+ stopCache();
+
+ startCache();
+
+ proxyList = (List) cache.getObject(fqn);
+
+ brian = (Person)proxyList.get(0);
+ assertEquals("Brian", brian.getName());
+ manik = (Person)proxyList.get(1);
+ assertEquals("Manik", manik.getName());
+
+ proxyList.remove(0);
+
+ manik = (Person)proxyList.get(0);
+ assertEquals("Manik", manik.getName());
+ }
}
16 years, 4 months
JBoss Cache SVN: r4852 - core/trunk/src/main/java/org/jboss/cache/interceptors.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2007-12-13 17:39:01 -0500 (Thu, 13 Dec 2007)
New Revision: 4852
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java
Log:
Whoops
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java 2007-12-13 22:36:59 UTC (rev 4851)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java 2007-12-13 22:39:01 UTC (rev 4852)
@@ -8,6 +8,7 @@
import org.jboss.cache.NodeSPI;
import org.jboss.cache.config.Configuration;
import static org.jboss.cache.config.Configuration.CacheMode;
+import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.loader.CacheLoader;
import org.jboss.cache.loader.CacheLoaderManager;
import org.jboss.cache.lock.NodeLock;
@@ -53,6 +54,7 @@
return log;
}
+ @Inject
protected void injectDependencies(TransactionTable txTable, CacheLoaderManager clm, Configuration configuration)
{
this.txTable = txTable;
16 years, 4 months