[jboss-cvs] JBossCache/examples/PojoCache/annotated50 ...

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


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

  Modified:    examples/PojoCache/annotated50     build.properties
                        build.xml readme.txt
  Added:       examples/PojoCache/annotated50     PojoCacheTasks.xml
  Log:
  Updated with pojocache-aop.xml
  
  Revision  Changes    Path
  1.3       +1 -4      JBossCache/examples/PojoCache/annotated50/build.properties
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: build.properties
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/examples/PojoCache/annotated50/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:41 -0000	1.2
  +++ build.properties	24 Sep 2006 09:25:52 -0000	1.3
  @@ -14,10 +14,7 @@
   output=${basedir}/output
   build=${output}/classes
   cache_home=${basedir}/../../..
  -lib=${cache_home}/lib
  -lib-50=${cache_home}/lib-50
  -etc=${cache_home}/etc
  -#resources=${cache_home}/resources
  +cache_lib=${cache_home}/lib
   
   #Directory for Junit test result. Subdirectory html contains the result in html format.
   reports=${output}/reports
  
  
  
  1.5       +92 -98    JBossCache/examples/PojoCache/annotated50/build.xml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: build.xml
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/examples/PojoCache/annotated50/build.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- build.xml	21 Sep 2006 16:12:17 -0000	1.4
  +++ build.xml	24 Sep 2006 09:25:52 -0000	1.5
  @@ -1,45 +1,59 @@
   <?xml version="1.0"?>
   
  -<project name="aop examples JDK50 annotated" default="help" >
  +<project name="aop examples JDK50 annotated" default="help">
   
     <property name="build.sysclasspath" value="ignore"/>
  -  <property name="junit.timeout" value="180000"/> <!-- 3 minutes -->
  +   <!-- 3 minutes -->
  +   <property name="junit.timeout" value="180000"/>
   
  +   <!-- We read in some properties here -->
     <property file="./build.properties"/>
   
  -  <!-- set local properties for this build -->
  +   <!-- This is your own directories -->
  +   <property name="output" value="${basedir}/output"/>
  +   <property name="source" value="${basedir}/src"/>
  +   <property name="build" value="${basedir}/build"/>
  +   <property name="cache_home" value="${cache_home}"/>
  +
     <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}"/>
  +
  +   <!-- This is import for the aopc and annoc -->
  +   <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.aopc.example -- run aop examples with annoc and aopc pre-compiler"/>
     </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">
  @@ -49,62 +63,42 @@
              debug="true"
              deprecation="true">
         <classpath>
  -        <path refid="lib.classpath" />
  +            <path refid="lib.classpath"/>
         </classpath>
       </javac>
   
  -    <copy todir="output/etc/META-INF" filtering="no" overwrite="yes">
  -       <fileset dir="${etc}/META-INF">
  -          <include name="*.xml"/>
  -       </fileset>
  -    </copy>
  -
  -    <copy todir="output/etc" filtering="no" overwrite="yes">
  -       <fileset dir="${etc}">
  -          <include name="log4j.xml"/>
  +      <copy todir="${output}/etc">
  +         <fileset dir="${cache_home}/etc">
  +            <include name="**/*"/>
          </fileset>
       </copy>
  -
  -  </target>
  -
  -   <target name="run.aop.example" depends="compile" description="run standalone server replicator.">
  -     <java classname="test.examples.StudentMaintTest" fork="yes" >
  -        <jvmarg value="-Djboss.aop.path=src/jboss-aop.xml"/>
  -        <jvmarg value="-javaagent:${lib}/jboss-aop-jdk50.jar"/>
  -        <sysproperty key="log4j.configuration" value="file:${output}/etc/log4j.xml"/>
  -        <classpath refid="lib.classpath" />
  -        <classpath path="${output}/etc" />
  -       <classpath path="${build}" />
  -     </java>
      </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="src/jboss-aop.xml"/>
  +   <target name="run.loadtime.example" depends="compile" description="run standalone server replicator.">
  +      <java classname="test.examples.StudentMaintTest" fork="yes">
  +         <jvmarg value="-Djboss.aop.path=${cache_home}/resources/pojocache-aop.xml"/>
  +         <jvmarg value="-javaagent:${cache_lib}/jboss-aop-jdk50.jar"/>
  +         <classpath refid="lib.classpath"/>
  +         <classpath path="${output}/etc"/>
            <classpath path="${build}"/>
  -      </aopc>
  +      </java>
      </target>
   
      <target name="run.aopc.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">
         <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.4       +4 -3      JBossCache/examples/PojoCache/annotated50/readme.txt
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: readme.txt
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/examples/PojoCache/annotated50/readme.txt,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- readme.txt	21 Sep 2006 16:12:17 -0000	1.3
  +++ readme.txt	24 Sep 2006 09:25:52 -0000	1.4
  @@ -18,15 +18,16 @@
   
   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
  -used by aopc can be found in the src directory.
  +The java source files for the example can be found in the src directory.
  +
  +Note that we have used jboss.aop.path to locate pojocache-aop.xml file.
   
   You can run the example through Ant.
   
  
  
  
  1.2       +50 -0     JBossCache/examples/PojoCache/annotated50/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:52 -0000	1.2
  @@ -0,0 +1,50 @@
  +<?xml version="1.0"?>
  +
  +<project name="PojoCache tasks">
  +   <!--
  +   Tasks definition for JDK50 aopc. In addition to annotate your POJO with JDK-14 style
  +   annotation, you will also 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.
  +
  +   To use this, you can use Ant import to import it into you regular build.xml (see the example
  +   build.xml here). You will need to pass in the following properties: user.build, where you
  +   output classes is located, and finally user.classpath is the path element that you java
  +   class is using.
  +   -->
  +
  +   <!-- Assuming we are at tools directory -->
  +   <property name="cache_home" value="${cache_home}"/>
  +   <property name="cache_lib" value="${cache_home}/lib"/>
  +   <property name="cache_resources" value="${cache_home}/resources"/>
  +
  +   <!-- set local properties for this build -->
  +   <path id="pojocache.lib.classpath">
  +      <fileset dir="${cache_lib}">
  +         <include name="jboss-common.jar"/>
  +         <include name="concurrent.jar"/>
  +         <include name="javassist.jar"/>
  +         <include name="trove.jar"/>
  +         <include name="jboss-cache.jar"/>
  +         <include name="jboss-aop-jdk50.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="pojocache.lib.classpath"/>
  +      <!-- If you have some problem on aopc, turn verbose true to debug -->
  +      <aopc compilerclasspathref="pojocache.lib.classpath" verbose="false">
  +         <src path="${user.build}"/>
  +         <aoppath path="${cache_resources}/pojocache-aop.xml"/>
  +         <classpath refid="user.classpath"/>
  +      </aopc>
  +   </target>
  +
  +</project>
  
  
  



More information about the jboss-cvs-commits mailing list