[jboss-cvs] JBossCache/etc ...
Ben Wang
bwang at jboss.com
Tue Oct 31 06:12:59 EST 2006
User: bwang
Date: 06/10/31 06:12:59
Modified: etc pojocacheWithTx.bsh oodb.bsh pojocache.bsh
Log:
Refactored to be consistent with Cache factory method name.
Revision Changes Path
1.3 +1 -1 JBossCache/etc/pojocacheWithTx.bsh
(In the diff below, changes in quantity of whitespace are not shown.)
Index: pojocacheWithTx.bsh
===================================================================
RCS file: /cvsroot/jboss/JBossCache/etc/pojocacheWithTx.bsh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- pojocacheWithTx.bsh 24 Sep 2006 15:54:51 -0000 1.2
+++ pojocacheWithTx.bsh 31 Oct 2006 11:12:59 -0000 1.3
@@ -21,7 +21,7 @@
String configFile = "META-INF/replSync-service.xml";
boolean toStart = false;
-cache = PojoCacheFactory.createInstance(configFile, toStart);
+cache = PojoCacheFactory.createCache(configFile, toStart);
joe = new Person();
joe.setName("Joe Black");
1.7 +10 -12 JBossCache/etc/oodb.bsh
(In the diff below, changes in quantity of whitespace are not shown.)
Index: oodb.bsh
===================================================================
RCS file: /cvsroot/jboss/JBossCache/etc/oodb.bsh,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- oodb.bsh 27 Apr 2006 07:22:02 -0000 1.6
+++ oodb.bsh 31 Oct 2006 11:12:59 -0000 1.7
@@ -1,10 +1,9 @@
//
-// Beanshell script to run the aop tree cache demo
+// Beanshell script to run the pojo cache demo
//
-import org.jboss.cache.PropertyConfigurator;
-import org.jboss.cache.aop.PojoCache;
-import org.jboss.cache.aop.*;
-import org.jboss.cache.aop.test.*;
+import org.jboss.cache.pojo.PojoCache;
+import org.jboss.cache.pojo.*;
+import org.jboss.cache.pojo.test.*;
// Tx imports
import javax.transaction.UserTransaction;
import javax.naming.*;
@@ -22,13 +21,12 @@
"org.jboss.cache.transaction.DummyContextFactory");
tx = (UserTransaction)new InitialContext(prop).lookup("UserTransaction");
-tree = new PojoCache();
-config = new PropertyConfigurator();
-// configure tree cache.
-config.configure(tree, "META-INF/oodb-service.xml");
+String configFile = "META-INF/oodb-service.xml";
+boolean toStart = false;
+tree = PojoCacheFactory.createCache(configFile, toStart);
tree.startService(); // kick start tree cache
-if(!tree.exists("/aop/joe")) {
+if(!tree.exists("/pojo/joe")) {
System.out.println("creating new instance of Person");
joe = new Person();
joe.setName("Joe Black");
@@ -39,11 +37,11 @@
addr.setStreet("123 Albert Ave");
addr.setZip(94086);
joe.setAddress(addr);
- tree.putObject("/aop/joe", joe); // add aop sanctioned object
+ tree.attach("/pojo/joe", joe); // add aop sanctioned object
}
else {
System.out.println("Joe already exists - retrieving it from JBossCache");
- joe=tree.getObject("/aop/joe");
+ joe=tree.find("/pojo/joe");
System.out.println("Joe is " + joe);
}
1.2 +1 -1 JBossCache/etc/pojocache.bsh
(In the diff below, changes in quantity of whitespace are not shown.)
Index: pojocache.bsh
===================================================================
RCS file: /cvsroot/jboss/JBossCache/etc/pojocache.bsh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- pojocache.bsh 24 Sep 2006 10:08:23 -0000 1.1
+++ pojocache.bsh 31 Oct 2006 11:12:59 -0000 1.2
@@ -9,7 +9,7 @@
String configFile = "META-INF/replSync-service.xml";
boolean toStart = false;
-cache = PojoCacheFactory.createInstance(configFile, toStart);
+cache = PojoCacheFactory.createCache(configFile, toStart);
joe = new Person();
joe.setName("Joe Black");
More information about the jboss-cvs-commits
mailing list