[jboss-cvs] JBossCache/examples/PojoCache/non-annotated ...

Ben Wang bwang at jboss.com
Sun Sep 24 05:25:53 EDT 2006


  User: bwang   
  Date: 06/09/24 05:25:53

  Modified:    examples/PojoCache/non-annotated     build.properties
                        build.xml readme.txt
  Added:       examples/PojoCache/non-annotated     PojoCacheTasks.xml
  Log:
  Updated with pojocache-aop.xml
  
  Revision  Changes    Path
  1.3       +3 -3      JBossCache/examples/PojoCache/non-annotated/build.properties
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: build.properties
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/examples/PojoCache/non-annotated/build.properties,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- build.properties	5 Feb 2006 11:54:42 -0000	1.2
  +++ build.properties	24 Sep 2006 09:25:53 -0000	1.3
  @@ -14,9 +14,9 @@
   output=${basedir}/output
   build=${output}/classes
   cache_home=${basedir}/../../..
  -lib=${cache_home}/lib
  -etc=${cache_home}/etc
  -resources=${cache_home}/resources
  +cache_lib=${cache_home}/lib
  +cache_etc=${cache_home}/etc
  +cache_resources=${cache_home}/resources
   
   #Directory for Junit test result. Subdirectory html contains the result in html format.
   reports=${output}/reports
  
  
  
  1.3       +75 -84    JBossCache/examples/PojoCache/non-annotated/build.xml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: build.xml
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/examples/PojoCache/non-annotated/build.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- build.xml	20 Sep 2006 10:45:45 -0000	1.2
  +++ build.xml	24 Sep 2006 09:25:53 -0000	1.3
  @@ -1,44 +1,52 @@
   <?xml version="1.0"?>
   
  -<project name="aop examples annotated" default="help" >
  +<project name="aop examples annotated" default="help">
   
     <property name="build.sysclasspath" value="ignore"/>
  -  <property name="junit.timeout" value="180000"/> <!-- 3 minutes -->
  +   <property name="junit.timeout" value="180000"/>
  +   <!-- 3 minutes -->
   
     <property file="./build.properties"/>
   
  -  <!-- set local properties for this build -->
     <path id="lib.classpath">
  -      <fileset dir="${lib}">
  -        <include name="**/*.jar" />
  +      <fileset dir="${cache_lib}">
  +         <include name="**/*.jar"/>
         </fileset>
  +   </path>
  +
  +   <!-- Need to define these before importing PojoCacheTasks.xml -->
  +   <!-- You define your own classpath here -->
  +   <path id="user.classpath">
         <pathelement path="${build}"/>
  +      <path refid="lib.classpath"/>
     </path>
  +   <property name="user.build" value="${build}"/>
  +   <property name="user.source" value="${source}"/>
  +
  +   <import file="PojoCacheTasks.xml" />
   
     <target name="help" description="help page">
  -      <echo message="build.sh &lt;command&gt; where command is:" />
  -      <echo message="         compile       -- compile the examples code" />
  -      <echo message="         clobber       -- clean up the whole directory" />
  -      <echo message="         run.aop.example -- run aop examples with annoc and aopc pre-compiler" />
  -      <echo message="         run.aop.demo  -- run demo gui for aop cache" />
  +      <echo message="build.sh &lt;command&gt; where command is:"/>
  +      <echo message="         compile       -- compile the examples code"/>
  +      <echo message="         clobber       -- clean up the whole directory"/>
  +      <echo message="         run.aop.example -- run aop examples with annoc and aopc pre-compiler"/>
  +      <echo message="         run.aop.demo  -- run demo gui for aop cache"/>
     </target>
   
     <!-- set up directory -->
     <target name="init" description="Prepare to build.">
       <!-- Create the time stamp -->
       <tstamp/>
  -    <!-- Create the build directory structure used by compile
  -    and copy the deployment descriptors into it-->
  +      <!-- Create the build directory structure used by compile and copy the deployment descriptors into it-->
       <mkdir dir="${build}"/>
       <mkdir dir="${reports}"/>
     </target>
   
     <target name="clean" description="Clean up compiled classes">
  -    <delete dir="${build}"/>
  -    <delete dir="${reports}"/>
  +      <delete dir="${output}"/>
     </target>
   
  -  <target name="clobber" depends="clean" />
  +   <target name="clobber" depends="clean"/>
   
     <!-- compile directory -->
     <target name="compile" depends="init" description="Build unit testing class">
  @@ -48,49 +56,32 @@
              debug="true"
              deprecation="true">
         <classpath>
  -        <path refid="lib.classpath" />
  +            <path refid="lib.classpath"/>
         </classpath>
       </javac>
   
        <copy todir="${output}/etc">
  -       <fileset dir="${etc}">
  +         <fileset dir="${cache_etc}">
             <include name="**/*"/>
          </fileset>
        </copy>
  -
  -  	  <!-- Use the jboss-aop.xml from the src dir -->
  -     <copy file="${source}/jboss-aop.xml"
  -     	     todir="${output}/etc/META-INF" overwrite="true"/>
  -
  -  </target>
  -
  -   <!-- pre-compile directory with aopc -->
  -   <target name="aopc" depends="compile" description="Precompile aop test classes after annoc">
  -
  -   	<taskdef name="aopc" classname="org.jboss.aop.ant.AopC" classpathref="lib.classpath"/>
  -
  -   	<aopc compilerclasspathref="lib.classpath" classpathref="lib.classpath" verbose="true">
  -        <src path="${build}/examples"/>
  -        <aoppath path="${output}/etc/META-INF/jboss-aop.xml"/>
  -         <classpath path="${build}"/>
  -      </aopc>
      </target>
   
     <target name="run.aop.example" depends="compile, aopc" description="run standalone server replicator.">
  -    <java classname="test.examples.StudentMaintTest" fork="yes" >
  -      <classpath refid="lib.classpath" />
  -      <classpath path="${build}" />
  -      <classpath path="${output}/etc" />
  +      <java classname="test.examples.StudentMaintTest" fork="yes">
  +         <classpath refid="lib.classpath"/>
  +         <classpath path="${build}"/>
  +         <classpath path="${output}/etc"/>
       </java>
     </target>
   
     <target name="run.aop.demo" depends="compile" description="run tree cache demo.">
  -    <java classname="org.jboss.cache.aop.TreeCacheView" fork="yes">
  +      <java classname="org.jboss.cache.aop.TreeCacheAopView" fork="yes">
         <jvmarg value="-Xmx128M"/>
  -      <classpath refid="lib.classpath" />
  +         <classpath refid="lib.classpath"/>
         <sysproperty key="log4j.configuration" value="file:${output}/etc/log4j.xml"/>
  -      <classpath path="${output}/etc" />
  -      <classpath path="${build}" />
  +         <classpath path="${output}/etc"/>
  +         <classpath path="${build}"/>
       </java>
     </target>
   
  
  
  
  1.2       +6 -4      JBossCache/examples/PojoCache/non-annotated/readme.txt
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: readme.txt
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/examples/PojoCache/non-annotated/readme.txt,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- readme.txt	5 Feb 2006 06:42:16 -0000	1.1
  +++ readme.txt	24 Sep 2006 09:25:53 -0000	1.2
  @@ -1,8 +1,10 @@
  -This is an example that illustrates using JBossCacheAop to replicate
  +This is an example that illustrates using PojoCache to replicate
   over a cluster state information about students and the courses they take.
   
   In this example, aopc is used to instrument the classes in the domain model
  -before the example is run. The classes are not annotated, so annoc is not used.
  +before the example is run. The classes are not annotated, meaning we specify
  +the POJO that needs to be instrumented in a user supplied xml file (in this
  +case user-aop.xml under src directory).
   
   The example involves 4 domain model classes, Person, Student, Address
   and Course.  Student is a subclass of Person.  A Person has an Address, while
  @@ -10,14 +12,14 @@
   
   The class test.examples.StudentMaintTest:
   
  -1. Creates two TreeCacheAop instances.
  +1. Creates two PojoCache instances.
   2. Creates two Student instances, assigns them an Address and a Course, and then
   puts them in the cache.
   3. Changes various state fields related to the Students and Courses, and 
   generates output to stdout to show that the state changes are reflected in the 
   other node in the cache.
   
  -The java source files for the example as well as the jboss-aop.xml file
  +The java source files for the example as well as the user-aop.xml file
   used by aopc can be found in the src directory.
   
   You can run the example through Ant.
  
  
  
  1.2       +40 -0     JBossCache/examples/PojoCache/non-annotated/PojoCacheTasks.xml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: PojoCacheTasks.xml
  ===================================================================
  RCS file: PojoCacheTasks.xml
  diff -N PojoCacheTasks.xml
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ PojoCacheTasks.xml	24 Sep 2006 09:25:53 -0000	1.2
  @@ -0,0 +1,40 @@
  +<?xml version="1.0"?>
  +
  +<project name="PojoCache tasks">
  +   <!--
  +   Tasks definition for aopc. ou will need to define the "source" and "build" directory. It will byte-code
  +   instrumented your POJOs and update them under build directory. You can verify this by doing
  +   a listing there to confirm creation of new (and additional) classes.
  +   -->
  +
  +   <!-- set local properties for this build -->
  +   <path id="pojocache.lib.classpath">
  +      <fileset dir="${cache_lib}">
  +         <include name="jboss-aop-jdk50.jar"/>
  +         <include name="jboss-cache.jar"/>
  +         <include name="jboss-common.jar"/>
  +         <include name="concurrent.jar"/>
  +         <include name="javassist.jar"/>
  +         <include name="trove.jar"/>
  +      </fileset>
  +   </path>
  +
  +   <path id="jboss.aop.classpath">
  +      <fileset dir="${cache_lib}">
  +         <include name="jboss-aop-jdk50.jar"/>
  +      </fileset>
  +   </path>
  +
  +   <!-- pre-compile directory with aopc -->
  +   <target name="aopc" depends="compile" description="Precompile aop test classes">
  +
  +      <taskdef name="aopc" classname="org.jboss.aop.ant.AopC" classpathref="jboss.aop.classpath"/>
  +
  +      <aopc compilerclasspathref="pojocache.lib.classpath" verbose="true">
  +         <src path="${build}"/>
  +         <aoppath path="${basedir}/src/user-aop.xml"/>
  +         <classpath refid="user.classpath"/>
  +      </aopc>
  +   </target>
  +
  +</project>
  
  
  



More information about the jboss-cvs-commits mailing list