[jboss-cvs] JBossCache/etc ...

Ben Wang bwang at jboss.com
Sun Sep 24 06:08:23 EDT 2006


  User: bwang   
  Date: 06/09/24 06:08:23

  Modified:    etc       build.xml runShellDemo.sh
  Added:       etc       pojocache.bsh pojocacheWithTx.bsh
  Removed:     etc       aop.bsh aopWithTx.bsh
  Log:
  renamed aop.bsh to pojocache.bsh, etc.
  
  Revision  Changes    Path
  1.17      +8 -8      JBossCache/etc/build.xml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: build.xml
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/etc/build.xml,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -b -r1.16 -r1.17
  --- build.xml	21 Sep 2006 08:33:33 -0000	1.16
  +++ build.xml	24 Sep 2006 10:08:23 -0000	1.17
  @@ -44,7 +44,7 @@
         <echo message="         clobber       -- clean up the whole directory" />
         <echo message="         run.batch     -- run batch examples" />
         <echo message="         one.test      -- run one single test case. Need -Dtest=org.jboss.cache.??Test" />
  -      <echo message="         one.test.pojo  -- run one single aop test case. Need -Dtest=org.jboss.cache.pojo.??Test" />
  +      <echo message="         one.test.pojo  -- run one single PojoCache test case. Need -Dtest=org.jboss.cache.pojo.??Test" />
         <echo message="         run.pojocache.batch -- run batch pojocache examples" />
         <echo message="         run.demo      -- run demo gui for plain cache" />
         <echo message="         run.pojocache.demo  -- run demo gui for pojocache cache" />
  @@ -83,7 +83,7 @@
   
         <copy todir="output/resources" filtering="no" overwrite="yes">
            <fileset dir="resources">
  -            <include name="jboss-aop.xml"/>
  +            <include name="pojocache-aop.xml"/>
            </fileset>
         </copy>
   
  @@ -230,7 +230,7 @@
     </target>
   
      <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  -   AOP section
  +   PojoCache section
      ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
   
      <!-- pre-compile directory with aopc -->
  @@ -245,7 +245,7 @@
         <aopc compilerclasspathref="aop.classpath" verbose="true">
            <src path="${build}"/>
            <include name="org/jboss/cache/pojo/test/**/*.class"/>
  -         <aoppath path="${output}/resources/jboss-aop.xml"/>
  +         <aoppath path="${output}/resources/pojocache-aop.xml"/>
            <classpath path="${build}"/>
            <classpath refid="lib.classpath"/>
         </aopc>
  @@ -271,7 +271,7 @@
      -->
   
           <junit printsummary="yes" timeout="${junit.timeout}" fork="yes">
  -           <jvmarg value="-Djboss.aop.path=${output}/resources/jboss-aop.xml"/>
  +           <jvmarg value="-Djboss.aop.path=${output}/resources/pojocache-aop.xml"/>
              <jvmarg value="-javaagent:${lib}/jboss-aop-jdk50.jar"/>
              <!-- jvmarg value="-Dbind.address=${bind.address}"/ -->
              <classpath path="${output}/etc" />
  @@ -293,7 +293,7 @@
      <!-- eg. ant run.examples -Dtest=org.jboss.test.cache.test.local.NoTxUnitTestCase -->
      <target name="one.test.pojocache" depends="compile" description="run one junit test case.">
        <junit printsummary="yes" timeout="${junit.timeout}" fork="yes">
  -        <jvmarg value="-Djboss.aop.path=${output}/resources/jboss-aop.xml"/>
  +        <jvmarg value="-Djboss.aop.path=${output}/resources/pojocache-aop.xml"/>
           <jvmarg value="-javaagent:${lib}/jboss-aop-jdk50.jar"/>
           <!-- jvmarg value="-Dbind.address=${bind.address}"/ -->
           <classpath path="${output}/etc" />
  @@ -316,7 +316,7 @@
        <junit printsummary="true" fork="yes" >
          <classpath refid="lib.classpath" />
          <classpath refid="build.classpath" />
  -       <jvmarg value="-Djboss.aop.path=${output}/resources/jboss-aop.xml"/>
  +       <jvmarg value="-Djboss.aop.path=${output}/resources/pojocache-aop.xml"/>
          <classpath path="${output}/etc" />
          <formatter type="xml" />
          <sysproperty key="log4j.configuration" value="file:${output}/etc/log4j.xml"/>
  @@ -340,7 +340,7 @@
         fork="yes" >
         <jvmarg value="-Xmx128M"/>
         <classpath refid="lib.classpath" />
  -      <jvmarg value="-Djboss.aop.path=${output}/resources/jboss-aop.xml"/>
  +      <jvmarg value="-Djboss.aop.path=${output}/resources/pojocache-aop.xml"/>
         <classpath refid="build.classpath" />
         <classpath path="${output}/etc" />
         <formatter type="xml" />
  
  
  
  1.8       +2 -4      JBossCache/etc/runShellDemo.sh
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: runShellDemo.sh
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/etc/runShellDemo.sh,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -b -r1.7 -r1.8
  --- runShellDemo.sh	19 Sep 2006 14:44:27 -0000	1.7
  +++ runShellDemo.sh	24 Sep 2006 10:08:23 -0000	1.8
  @@ -17,7 +17,7 @@
   done
   
   
  -AOP_PATH=$CACHE_OUTPUT/etc/META-INF
  +AOP_PATH=$CACHE_OUTPUT/resources/pojocache-aop.xml
   
   LOG4J=$CACHE_OUTPUT/etc/log4j.xml
   
  @@ -39,8 +39,6 @@
   
   #JAVA_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n"
   
  -# Use aopc now instead of load-time mode
  -sh build.sh aopc
  -ARGS="-Dlog4j.configuration=file:$L4J"
  +ARGS="-javaagent:${CACHE_LIB}/jboss-aop-jdk50.jar -Dlog4j.configuration=file:$L4J"
   
   java -cp $CP $ARGS $JAVA_OPTS -Djboss.aop.aoppath=$AOP_PATH  bsh.Console &
  
  
  
  1.1      date: 2006/09/24 10:08:23;  author: bwang;  state: Exp;JBossCache/etc/pojocache.bsh
  
  Index: pojocache.bsh
  ===================================================================
  //
  // Beanshell script to run the pojocache demo
  //
  import org.jboss.cache.pojo.PojoCacheFactory;
  import org.jboss.cache.pojo.PojoCache;
  import org.jboss.cache.pojo.test.*;
  
  show();  // verbose mode
  
  String configFile = "META-INF/replSync-service.xml";
  boolean toStart = false;
  cache = PojoCacheFactory.createInstance(configFile, toStart);
  
  joe = new Person();
  joe.setName("Joe Black");
  joe.setAge(31);
  
  addr = new Address();
  addr.setCity("Sunnyvale");
  addr.setStreet("123 Albert Ave");
  addr.setZip(94086);
  
  joe.setAddress(addr);
  
  cache.start();  // kick start cache
  
  cache.attach("pojo/joe", joe); // add pojocache sanctioned object
  
  // since it is pojocache-sanctioned, use of plain get/set methods will take care of cache content automatically.
  joe.setAge(41);
  
  // cache.stop(); // will stop the cache
  
  
  
  1.1      date: 2006/09/24 10:08:23;  author: bwang;  state: Exp;JBossCache/etc/pojocacheWithTx.bsh
  
  Index: pojocacheWithTx.bsh
  ===================================================================
  //
  // Beanshell script to run the aop tree cache demo
  //
  import org.jboss.cache.pojo.PojoCache;
  import org.jboss.cache.pojo.PojoCacheFactory;
  import org.jboss.cache.pojo.test.*;
  // Tx imports
  import javax.transaction.UserTransaction;
  import javax.naming.*;
  import org.jboss.cache.transaction.DummyTransactionManager;
  
  show();  // verbose mode
  
  // Set up transaction manager
  DummyTransactionManager.getInstance();
  
  prop = new Properties();
  prop.put(Context.INITIAL_CONTEXT_FACTORY,
      "org.jboss.cache.transaction.DummyContextFactory");
  tx = (UserTransaction)new InitialContext(prop).lookup("UserTransaction");
  
  String configFile = "META-INF/replSync-service.xml";
  boolean toStart = false;
  cache = PojoCacheFactory.createInstance(configFile, toStart);
  
  joe = new Person();
  joe.setName("Joe Black");
  joe.setAge(31);
  
  addr = new Address();
  addr.setCity("Sunnyvale");
  addr.setStreet("123 Albert Ave");
  addr.setZip(94086);
  
  joe.setAddress(addr);
  
  cache.start();  // kick start tree cache
  cache.attach("pojo/joe", joe); // add pojocache sanctioned object
  
  // since it is pojocache-sanctioned, use of plain get/set methods will take care of cache content automatically.
  // This is also transacted.
  tx.begin();
  joe.setAge(41);
  tx.commit();
  
  //joe.languages=new ArrayList();
  //joe.languages.add("German");
  //joe.languages.add("French");
  
  //joe; // this will cause NPE
  
  // cache.stop(); // will stop the cache
  
  
  



More information about the jboss-cvs-commits mailing list