[jboss-cvs] JBossAS SVN: r62882 - in projects/aop/trunk/aop/docs/examples: annotation and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue May 8 13:37:17 EDT 2007


Author: kabir.khan at jboss.com
Date: 2007-05-08 13:37:17 -0400 (Tue, 08 May 2007)
New Revision: 62882

Added:
   projects/aop/trunk/aop/docs/examples/valid_targets_annotated.html
   projects/aop/trunk/aop/docs/examples/valid_targets_not_annotated.html
Modified:
   projects/aop/trunk/aop/docs/examples/annotation/annotation.html
   projects/aop/trunk/aop/docs/examples/annotation14/annotation.html
   projects/aop/trunk/aop/docs/examples/annotation14/build.xml
   projects/aop/trunk/aop/docs/examples/annotation14/complex.java
   projects/aop/trunk/aop/docs/examples/annotation14/single.java
   projects/aop/trunk/aop/docs/examples/annotation14/trace.java
   projects/aop/trunk/aop/docs/examples/examples.html
Log:
[JBAOP-399][JBAOP-311] Update annotation14 example to work with AOP 2.0


Modified: projects/aop/trunk/aop/docs/examples/annotation/annotation.html
===================================================================
--- projects/aop/trunk/aop/docs/examples/annotation/annotation.html	2007-05-08 16:29:44 UTC (rev 62881)
+++ projects/aop/trunk/aop/docs/examples/annotation/annotation.html	2007-05-08 17:37:17 UTC (rev 62882)
@@ -1,20 +1,29 @@
 <html>
 <body>
 <p>
-<h2>Annotations for JDK 1.5</h2>
+<h2>Annotations for JDK 5</h2>
 
 </p><p>
-<h4>Overview</h4>
+<h3>Overview</h3>
 
-JDK 1.5 has a new interesting feature called annotations.  It allows you to specify xdoclet like tags right in the Java language just as you can with C#.  These tags are typesafe and access to them is available at compile time, load-time, and run-time.  See <a href="http://www.jcp.org/en/jsr/detail?id=175">JSR-175</a> for more detail.  JBossAOP since beta2 does support JDK1.5 annotations
+JDK 5 has a new interesting feature called annotations.  It allows you to specify xdoclet like tags right in the Java language just as you can with C#.  These tags are typesafe and access to them is available at compile time, load-time, and run-time.  See <a href="http://www.jcp.org/en/jsr/detail?id=175">JSR-175</a> for more detail.  JBossAOP since beta2 does support JDK 5 annotations
 </p><p>
 A good way to visualize metadata is to think of classnames, method names, field names, and constructor signatures as nouns, and annotations/metadata as adjectives.  You can declare advice/interceptor bindings like:  All @Remotable objects should register with a dispatcher whenever they are constructed.  Any method marked @transactional begin/commit/rollback a transaction at the start and end of the method.  Or even any field, method, constructor marked @traceable, do tracing.  It kinda lets the application developer give hints to the aspect developer.  If you think about it another way, combining annotations and AOP allows you to plug in new Java keywords.  Kinda like C pre-processor macros on steroids.  Macros that are typesafe and checked by the compiler and unlike Major League Baseball players, it will always be legal for you to use these steroids in your applications.
 </p><p>
-<h4>Example code</h4>
 
+<a name="ann14"/>
+<h3>Annotations for JDK 1.4</h3>
+<p>Although not supported in JDK 1.4, JBoss AOP allows you a few ways to use annotations with JDK 5.
+One way is as shown in the the
+<a href="../valid_targets_annotated.html"/>annotated examples guide</a> whereby you code your classes using
+JDK 5, and transform your classes into JDK 1.4 bytecode using JBoss Retro. Another way is to use the annotation
+compiled, as shown in <a href="../annotation14/annotation.html">JDK 5 Annotations with JDK 1.4</a>.</p>
+
+<h3>Example code</h3>
+
 The example code applies 2 separate interceptors via tags supplied in a Java source file.  One of the interceptors is a tracing interceptor that is trigger by a @trace annotation, the other is B2B functionality that will bill/charge a user for each access of the api.  This is also triggered by an annotation.
 </p><p>
-<h4>Declaring annotations</h4>
+<h3>Declaring annotations</h3>
 
 Open up POJO.java.  This is the source file for where our annotations will be declared.
 </p><p>
@@ -25,13 +34,13 @@
       System.out.println("someMethod");
    }
 </pre>
-In the above example, we are declaring someMethod() to be traced and billable.  Don't forget!  At least with JDK 1.5 beta, you must compile your Java source files with 1.5 source to have annotations compile.
+In the above example, we are declaring someMethod() to be traced and billable.
 <pre>
-$ javac -source 1.5 MyFile.java
+$ javac MyFile.java
 </pre>
 </p><p>
 </p><p>
-<h4>Annotations in pointcut expressions</h4>
+<h3>Annotations in pointcut expressions</h3>
 
 Annotations can be referenced by an '@' sign in pointcut expressions.  They can only be used in the class expressions for a method, field, or constructor for execution and caller pointcuts.  They can also be used in substitute for 'new' in constructor land, and for a method or field name.  Take a look at jboss-aop.xml
 </p><p>
@@ -56,10 +65,12 @@
 </p><p>
 The above states that for any field, constructor, or method tagged as @trace, apply the TraceInterceptor.
 </p><p>
-<h4>Running</h4>
 
+
+<h3>Running</h3>
+
 <p>
-<b>THIS EXAMPLE REQUIRES JDK 1.5!! For other options, please look at the
+<b>THIS EXAMPLE REQUIRES JDK 5!! For other options, please look at the
 <a href="../valid_targets_annotated.html"/>annotated examples guide</a></b> To compile and run:</p>
 <pre>
   $ run.aopc.50

Modified: projects/aop/trunk/aop/docs/examples/annotation14/annotation.html
===================================================================
--- projects/aop/trunk/aop/docs/examples/annotation14/annotation.html	2007-05-08 16:29:44 UTC (rev 62881)
+++ projects/aop/trunk/aop/docs/examples/annotation14/annotation.html	2007-05-08 17:37:17 UTC (rev 62882)
@@ -1,16 +1,20 @@
 <html>
 <body>
 <p>
-<h2>JDK 1.5 Annotations with JDK 1.4</h2>
+<h2>JDK 5 Annotations with JDK 1.4</h2>
 
-</p><p>
+</p>
+<p><i><b>This topic has been deprecated in favour of using JBoss Retro as discussed in <a href="../annotation/annotation.html#ann14">annotations in JDK 1.4</a>.
+It does however exist for users for who compiling things with JDK 5 is NOT an option.</b></i></p>
+
 <h4>Overview</h4>
 
-JDK 1.5 has a new interesting feature called annotations.  It allows you to specify xdoclet like tags right in the Java language just as you can with C#.  These tags are typesafe and access to them is available at compile time, load-time, and run-time.  See <a href="http://www.jcp.org/en/jsr/detail?id=175">JSR-175</a> for more detail.  JBossAOP since beta2 does support JDK1.5 annotations
+<p>
+JDK 5 has a new interesting feature called annotations.  It allows you to specify xdoclet like tags right in the Java language just as you can with C#.  These tags are typesafe and access to them is available at compile time, load-time, and run-time.  See <a href="http://www.jcp.org/en/jsr/detail?id=175">JSR-175</a> for more detail.  JBossAOP since beta2 does support JDK 5 annotations
 </p><p>
 A good way to visualize metadata is to think of classnames, method names, field names, and constructor signatures as nouns, and annotations/metadata as adjectives.  You can declare advice/interceptor bindings like:  All @Remotable objects should register with a dispatcher whenever they are constructed.  Any method marked @transactional begin/commit/rollback a transaction at the start and end of the method.  Or even any field, method, constructor marked @traceable, do tracing.  It kinda lets the application developer give hints to the aspect developer.  If you think about it another way, combining annotations and AOP allows you to plug in new Java keywords.  Kinda like C pre-processor macros on steroids.  Macros that are typesafe and checked by the compiler and unlike Major League Baseball players, it will always be legal for you to use these steroids in your applications.
 </p><p>
-So, what good are JDK 1.5 annotations if you're using a JDK 1.4 compiler????  Well, JBoss AOP has an annotation compiler for JDK 1.4 that can convert typed annotations from doclet tags and embed them in your class files.  This bytecode manipulation is compatible with JDK 1.5.
+So, what good are JDK 5 annotations if you're using a JDK 1.4 compiler????  Well, JBoss AOP has an annotation compiler for JDK 1.4 that can convert typed annotations from doclet tags and embed them in your class files.  This bytecode manipulation is compatible with JDK 5.
 </p><p>
 <h4>Example code</h4>
 
@@ -18,11 +22,11 @@
 </p><p>
 <h4>Implementing annotations</h4>
 
-Open up complex.java.  You'll see that it is a regular interface.  This is our annotation implementation and is the same as JDK 1.5 except <i>@interface</i> is replaced with a plain interface.
+Open up complex.java.  You'll see that it is a regular interface.  This is our annotation implementation and is the same as JDK 5 except <i>@interface</i> is replaced with a plain interface. One <b>difference from AOP 1.x</b> is that the interfaces defining the annotations must now extend <i>org.jboss.lang.Annotation</i>, this is because JBoss Retro is now the primary mechanism for using <a href="../annotation/annotation.html#ann14">annotations in JDK 1.4</a>.
 </p><p>
 complex.java
 <pre>
-public interface complex
+public interface complex extends org.jboss.lang.Annotation
 {
    char ch();
    String string();
@@ -37,15 +41,16 @@
    Class clazz();
 }
 </pre>
-</p><p>
+</p>
+<p></p>
 <h4>Declaring annotations</h4>
 
-Open up POJO.java.  This is the source file for where our annotations will be declared.  The syntax is exactly the same as JDK 1.5 annotations except that they are embedded as doclet tags and you use a double at sign '@@'.  
+Open up POJO.java.  This is the source file for where our annotations will be declared.  The syntax is exactly the same as JDK 5 annotations except that they are embedded as doclet tags and you use a double at sign '@@'.
 <b>IMPORTANT NOTE</b> You must have a space after the tag name otherwise you will get a compilation error.  This is the quirkiness of the QDox doclet compiler.
 </p><p>
 <pre>
    /**
-    * @@trace 
+    * @@trace
     * @@single ("hello world")
     * @@complex (ch='a', string="hello world", flt=5.5, dbl=6.6, shrt=5, lng=6, integer=7, bool=true, annotation=@single("hello"), array={"hello", "world"}, clazz=java.lang.String)
     */
@@ -73,7 +78,7 @@
 </ol>
 
 </p><p>
-The bytecode manipulations done to annotated classes are compatible with JDK 1.5.  So, if you rewrite your JDk 1.4 annotations interfaces (changing the keyword interface to @interface), the annotated classes can be used with both JDK 1.4 and 1.5.  I was going to ship an implementation of java.lang.annotation.Annotation and force JDK 1.4 annotation interfaces to implement this (and thus be fully binary compatible), but the Java license forbids you to distribute anything under the java.lang package. :(  Oh well.
+The bytecode manipulations done to annotated classes are compatible with JDK 5.  So, if you rewrite your JDk 1.4 annotations interfaces (changing the keyword interface to @interface), the annotated classes can be used with both JDK 1.4 and 5.  I was going to ship an implementation of java.lang.annotation.Annotation and force JDK 1.4 annotation interfaces to implement this (and thus be fully binary compatible), but the Java license forbids you to distribute anything under the java.lang package. :(  Oh well.
 </p><p>
 </p><p>
 <h4>Annotations in pointcut expressions</h4>
@@ -90,7 +95,7 @@
 </p><p>
 <h4>Accessing annotations at runtime</h4>
 
-The org.jboss.aop.annotation.AnnotationElement is an abstraction to obtain annotations at runtime.  It works with both JDK 1.4 and JDK 1.5 so you can write portable code.  The TraceInterceptor shows how to access annotations.
+The org.jboss.aop.annotation.AnnotationElement is an abstraction to obtain annotations at runtime.  It works with both JDK 1.4 and JDK 5 so you can write portable code.  The TraceInterceptor shows how to access annotations.
 </p><p>
 <pre>
          complex c = (complex)AnnotationElement.getAnyAnnotation(((MethodInvocation)invocation).getMethod(), complex.class);

Modified: projects/aop/trunk/aop/docs/examples/annotation14/build.xml
===================================================================
--- projects/aop/trunk/aop/docs/examples/annotation14/build.xml	2007-05-08 16:29:44 UTC (rev 62881)
+++ projects/aop/trunk/aop/docs/examples/annotation14/build.xml	2007-05-08 17:37:17 UTC (rev 62882)
@@ -1,52 +1,19 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
-<project default="run" name="JBoss/AOP">
-   <target name="prepare">
-      <property name="jboss.aop.root" value="../../../.."/>
-      <property name="jboss.aop.lib" value="${jboss.aop.root}/lib"/>
-      <property name="jboss.aop.lib50" value="${jboss.aop.root}/lib-50"/>
- 
-      <path id="jboss.aop.classpath">
-         <fileset dir="${jboss.aop.lib}">
-            <include name="*.jar"/>
-         </fileset>
-      </path>
+<project default="usage" name="JBoss/AOP">
+   <import file="../examples-build.xml"/>
 
-      <path id="jboss.aop.classpath50">
-         <fileset dir="${jboss.aop.lib50}">
-            <include name="*.jar"/>
-         </fileset>
-      </path>
+   <target name="annotationc" depends="_compile14">
+      <taskdef name="annotationc" classname="org.jboss.aop.ant.AnnotationC" classpathref="jboss.aop.classpath14"/>
+      <annotationc compilerclasspathref="classpath14" classpathref="classpath14" bytecode="true">
+         <src path="."/>
+      </annotationc>
+   </target>
 
-      <path id="classpath">
-         <path refid="jboss.aop.classpath"/>
-         <pathelement path="."/>
-      </path>
-	  
-      <property name="aop50jar" value="${jboss.aop.lib50}/jboss-aop-jdk50.jar"/>
+   <target name="aopc" depends="annotationc">
 
-      <path id="classpath50">
-         <path refid="jboss.aop.classpath50"/>
-         <pathelement path="."/>
-      </path>
-
-      <taskdef name="annotationc" classname="org.jboss.aop.ant.AnnotationC" classpathref="jboss.aop.classpath"/>
-      <taskdef name="aopc" classname="org.jboss.aop.ant.AopC" classpathref="jboss.aop.classpath"/>
-   </target>
-
-   <target name="compile" depends="prepare">
-      <javac srcdir="."
-         destdir="."
-         debug="on"
-         deprecation="on"
-         optimize="off"
-         includes="**">
-         <classpath refid="classpath"/>
-      </javac>
-      <annotationc compilerclasspathref="classpath" classpathref="classpath" bytecode="true">
-         <src path="."/>
-      </annotationc>
-      <aopc compilerclasspathref="classpath" classpathref="classpath" verbose="true">
+      <taskdef name="aopc" classname="org.jboss.aop.ant.AopC" classpathref="jboss.aop.classpath14"/>
+      <aopc compilerclasspathref="classpath14" classpathref="classpath14" verbose="true">
          <classpath path="."/>
          <src path="."/>
          <aoppath>
@@ -55,11 +22,44 @@
       </aopc>
    </target>
 
-   <target name="run" depends="compile">
+   <target name="run.aopc.14" depends="aopc">
+
       <java fork="yes" failOnError="true" className="Driver">
          <sysproperty key="jboss.aop.path" value="jboss-aop.xml"/>
-         <classpath refid="classpath"/>
+         <classpath refid="classpath14"/>
       </java>
    </target>
 
+   <target name="run.loadtime.14" depends="annotationc">
+
+      <!-- Create the classloader hook -->
+      <mkdir dir="jboss.aop.lib14/jdk14hook"/>
+      <java fork="yes" classname="org.jboss.aop.hook.GenerateInstrumentedClassLoader">
+         <classpath>
+            <path refid="jboss.aop.classpath14"/>
+         </classpath>
+         <arg value="${jboss.aop.lib14}/jdk14hook"/>
+      </java>
+
+      <path id="bootclasspath">
+         <pathelement location="${jboss.aop.lib14}/jdk14hook"/>
+         <path refid="jboss.aop.classpath14"/>
+      </path>
+      <property name="bootclasspath" refid="bootclasspath"/>
+
+      <java fork="yes" failOnError="true" className="Driver" jvm="${jdk14.java}">
+         <sysproperty key="jboss.aop.path" value="jboss-aop.xml"/>
+         <jvmarg value="-Xbootclasspath/p:${bootclasspath}"/>
+         <classpath path="."/>
+      </java>
+   </target>
+
+   <target name="run.aopc.50" depends="run.aopc.14">
+      <!-- There isn't really much point in running the annotation compiler with JDK 5 -->
+   </target>
+
+   <target name="run.loadtime.50" depends="run.loadtime.14">
+      <!-- There isn't really much point in running the annotation compiler with JDK 5 -->
+   </target>
+
 </project>

Modified: projects/aop/trunk/aop/docs/examples/annotation14/complex.java
===================================================================
--- projects/aop/trunk/aop/docs/examples/annotation14/complex.java	2007-05-08 16:29:44 UTC (rev 62881)
+++ projects/aop/trunk/aop/docs/examples/annotation14/complex.java	2007-05-08 17:37:17 UTC (rev 62882)
@@ -19,7 +19,7 @@
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
-public interface complex
+public interface complex extends org.jboss.lang.Annotation
 {
    char ch();
    String string();

Modified: projects/aop/trunk/aop/docs/examples/annotation14/single.java
===================================================================
--- projects/aop/trunk/aop/docs/examples/annotation14/single.java	2007-05-08 16:29:44 UTC (rev 62881)
+++ projects/aop/trunk/aop/docs/examples/annotation14/single.java	2007-05-08 17:37:17 UTC (rev 62882)
@@ -19,7 +19,7 @@
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
-public interface single
+public interface single extends org.jboss.lang.Annotation
 {
    String value();
 }

Modified: projects/aop/trunk/aop/docs/examples/annotation14/trace.java
===================================================================
--- projects/aop/trunk/aop/docs/examples/annotation14/trace.java	2007-05-08 16:29:44 UTC (rev 62881)
+++ projects/aop/trunk/aop/docs/examples/annotation14/trace.java	2007-05-08 17:37:17 UTC (rev 62882)
@@ -20,4 +20,4 @@
   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
   */
 
-public interface trace {}
+public interface trace extends org.jboss.lang.Annotation {}

Modified: projects/aop/trunk/aop/docs/examples/examples.html
===================================================================
--- projects/aop/trunk/aop/docs/examples/examples.html	2007-05-08 16:29:44 UTC (rev 62881)
+++ projects/aop/trunk/aop/docs/examples/examples.html	2007-05-08 17:37:17 UTC (rev 62882)
@@ -21,8 +21,8 @@
 <li> <a href="caller/caller.html">Caller pointcuts</a></li>
 <li> <a href="instanceof/instanceof.html">Instanceof</a></li>
 <li> <a href="implements/implements.html">Implements</a></li>
-<li> <a href="annotation/annotation.html">JDK 1.5 Annotations</a></li>
-<li> <a href="annotation14/annotation.html">JDK 1.5 Annotations with JDK 1.4</a></li>
+<li> <a href="annotation/annotation.html">JDK 5 Annotations</a></li>
+<li> <a href="annotation14/annotation.html">JDK 5 Annotations with JDK 1.4</a></li>
 <li> <a href="metadata/metadata.html">JBoss AOP metadata</a></li>
 <li> <a href="cflow/cflow.html">Control flow</a></li>
 <li> <a href="dynamic_cflow/cflow.html">Dynamic control flow</a></li>

Added: projects/aop/trunk/aop/docs/examples/valid_targets_annotated.html
===================================================================
--- projects/aop/trunk/aop/docs/examples/valid_targets_annotated.html	                        (rev 0)
+++ projects/aop/trunk/aop/docs/examples/valid_targets_annotated.html	2007-05-08 17:37:17 UTC (rev 62882)
@@ -0,0 +1,63 @@
+<html>
+<body>
+<p>
+<h1>Annotated examples</h1>
+<p>This example uses JDK 5 annotations. To execute the ant file that comes with the example
+you need to be set up to use JDK 5, since the annotations will only compile with JDK 5 or above</p>
+
+<h2>Run with JDK 5</h2>
+<p>The two main targets for running with JDK 5 are<p>
+<pre>
+$ ant run.aopc.50
+$ ant run.loadtime.50
+</pre>
+
+<h3>ant.run.aopc.50</h3>
+<p>The <i>ant.run.aopc.50</i> target uses compile-time weaving, and performs the following steps:</p>
+<ul>
+   <li>Compiles the classes using JDK 5</li>
+   <li>Runs the AOPC compiler using JDK 5</li>
+   <li>Runs the woven example using JDK 5</li>
+</ul>
+
+<h3>ant.loadtime.aopc.50</h3>
+<p>The <i>ant.loadtime.aopc.50</i> target uses load-time weaving (the classes are
+transformed when first loaded) and performs the following steps:</p>
+<ul>
+   <li>Compiles the classes using JDK 5</li>
+   <li>Runs the example using JDK 5, with the <i>-javagent</i> switch passed in to
+   the java runtime to enable loadtime weaving</li>
+</ul>
+
+<h2>Run with JDK 1.4</h2>
+<p>We might want to make use of annotations in our code, but still deploy to a JDK 1.4 environment.
+JBoss AOP ships with JBoss Retro which allows you to modify JDK 5 bytecode to run on JDK 1.4. To use
+annotations we still need to compile with JDK 5, the following two targets illustrate the steps to run
+annotated code on JDK 1.4:</p>
+<pre>
+$ ant run.aopc.14
+$ ant run.loadtime.14
+</pre>
+
+<h3>ant.run.aopc.14</h3>
+<p>The <i>ant.run.aopc.14</i> target uses compile-time weaving, and performs the following steps:</p>
+<ul>
+   <li>Compiles the classes using JDK 5 (otherwise the annotations will not compile)</li>
+   <li>Runs the JBoss Retro processor to transform the JDK 5 bytecode into JDK 1.4 bytecode</li>
+   <li>Runs the AOPC compiler</li>
+   <li>Switches to JDK 1.4, and runs the woven example using JDK 1.4 with jbossretro-rt.jar on the classpath.
+   You need to specify the location of the JDK 1.4 executable in the <i>jdk14.java</i> property in the
+   <a href="../examples/examples.properties">examples.properties</a> file.</li>
+</ul>
+
+<h3>ant.loadtime.14</h3>
+<p>The <i>ant.loadtime.14</i> target uses loadtime-time weaving (the classes are:</p>
+transformed when first loaded) and performs the following steps:
+<ul>
+   <li>Compiles the classes using JDK 5 (otherwise the annotations will not compile)</li>
+   <li>Runs the JBoss Retro processor to transform the JDK 5 bytecode into JDK 1.4 bytecode</li>
+   <li>Switches to JDK 1.4, and runs the woven example using JDK 1.4 with jbossretro-rt.jar on the classpath,
+   and with the <i>-Xbootclasspath/p:</i> switch passed in to the java runtime to enable loadtime weaving.
+   You need to specify the location of the JDK 1.4 executable in the <i>jdk14.java</i> property in the
+   <a href="../examples/examples.properties">examples.properties</a> file.</li>
+</ul>

Added: projects/aop/trunk/aop/docs/examples/valid_targets_not_annotated.html
===================================================================
--- projects/aop/trunk/aop/docs/examples/valid_targets_not_annotated.html	                        (rev 0)
+++ projects/aop/trunk/aop/docs/examples/valid_targets_not_annotated.html	2007-05-08 17:37:17 UTC (rev 62882)
@@ -0,0 +1,58 @@
+<html>
+<body>
+<p>
+<h1>Non-annotated examples</h1>
+<p>This example can be run with either JDK 5 or JDK 1.4</p>
+
+<h2>Run with JDK 5</h2>
+<p>The two main targets for running with JDK 5 are<p>
+<pre>
+$ ant run.aopc.50
+$ ant run.loadtime.50
+</pre>
+<p>These are compiled against the JBoss AOP libraries for JDK 5, and so will work with JDK 5 only</p>
+
+
+<h3>ant.run.aopc.50</h3>
+<p>The <i>ant.run.aopc.50</i> target uses compile-time weaving, and performs the following steps
+<ul>
+   <li>Compiles the classes using JDK 5</li>
+   <li>Runs the AOPC compiler using JDK 5</li>
+   <li>Runs the woven example using JDK 5</li>
+</ul>
+
+<h3>ant.loadtime.aopc.50</h3>
+<p>The <i>ant.loadtime.aopc.50</i> target uses load-time weaving (the classes are
+transformed when first loaded) and performs the following steps:
+<ul>
+   <li>Compiles the classes using JDK 5</li>
+   <li>Runs the example using JDK 5, with the <i>-javagent</i> switch passed in to
+   the java runtime to enable loadtime weaving</li>
+</ul>
+
+<h2>Run with JDK 1.4</h2>
+<p>The following two targets illustrate the steps to run
+annotated code on JDK 1.4.
+<pre>
+$ ant run.aopc.14
+$ ant run.loadtime.14
+</pre>
+<p>These are compiled against the JBoss AOP libraries for JDK 1.4, and so will work regardless of if your chosen JDK
+is JDK 1.4 or JDK 5.
+
+<h3>ant.run.aopc.14</h3>
+<p>The <i>ant.run.aopc.14</i> target uses compile-time weaving, and performs the following steps
+<ul>
+   <li>Compiles the classes using your chosen JDK</li>
+   <li>Runs the AOPC compiler</li>
+   <li>Runs the woven example using your chosen JDK</li>
+</ul>
+
+<h3>ant.loadtime.14</h3>
+<p>The <i>ant.loadtime.14</i> target uses loadtime-time weaving (the classes are
+transformed when first loaded) and performs the following steps:
+<ul>
+   <li>Compiles the classes using your chosen JDK</li>
+   <li>Runs the example using JDK 5, with the <i>-Xbootclasspath/p:</i> switch passed in to
+   the java runtime to enable loadtime weaving</li>
+</ul>




More information about the jboss-cvs-commits mailing list