aboutsummaryrefslogtreecommitdiffstats
path: root/docs/dist
diff options
context:
space:
mode:
authoraclement <aclement>2005-11-15 16:55:56 +0000
committeraclement <aclement>2005-11-15 16:55:56 +0000
commit4ea00513761eeb32b3403caa1a3ba39f9218a839 (patch)
treec573d4ba824e54558736bfa42cb23cde6e91efcd /docs/dist
parentba1ff19cc794b2f6d2e0b95f3f80bf13093fd5b4 (diff)
downloadaspectj-4ea00513761eeb32b3403caa1a3ba39f9218a839.tar.gz
aspectj-4ea00513761eeb32b3403caa1a3ba39f9218a839.zip
matthews fixes for 95517
Diffstat (limited to 'docs/dist')
-rw-r--r--docs/dist/doc/examples/ltw/HelloWorld.java16
-rw-r--r--docs/dist/doc/examples/ltw/README39
-rw-r--r--docs/dist/doc/examples/ltw/Tracing.aj23
3 files changed, 68 insertions, 10 deletions
diff --git a/docs/dist/doc/examples/ltw/HelloWorld.java b/docs/dist/doc/examples/ltw/HelloWorld.java
new file mode 100644
index 000000000..8201a8f68
--- /dev/null
+++ b/docs/dist/doc/examples/ltw/HelloWorld.java
@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * Matthew Webster initial implementation
+ */
+public class HelloWorld {
+
+ public static void main (String[] args) {
+ System.out.println("Hello World!");
+ }
+}
diff --git a/docs/dist/doc/examples/ltw/README b/docs/dist/doc/examples/ltw/README
index 92011019e..f749692ac 100644
--- a/docs/dist/doc/examples/ltw/README
+++ b/docs/dist/doc/examples/ltw/README
@@ -1,23 +1,42 @@
-The bin directory of your AspectJ distribution contains a script "aj" to
-perform load-time weaving. Java classes on the CLASSPATH are loaded and
-woven with aspects on the ASPECTPATH.
-This feature is only supported on JDK 1.4 and later.
+For users of JDK 1.4 the bin directory of your AspectJ distribution
+contains a script "aj" to perform load-time weaving. Java classes on
+the CLASSPATH are loaded and woven with aspects also on the CLASSPATH
+which are declared in an aop.xml file. This file is either created by
+the user or generated by the compiler. Alternatively aspects can be
+loaded from an explicitly defined ASPECTPATH.
---To compile the tracing example--
+For users of JDK 1.5 the bin directory of your AspectJ distribution
+contains a script "aj5" to perform load-time weaving using an agent.
+This uses an aop.xml as described above.
- ant -f ../build.xml tracing-lt
+--To compile the HelloWorld program--
+
+ ajc -outjar hello.jar HelloWorld.java
+
+--To compile the Tracing aspect--
+
+ ajc -outjar tracing.jar -outxml Tracing.aj
--To run the example--
- set CLASSPATH to include "../jars/tracingApp.jar"
+ set CLASSPATH to include hello.jar
- aj tracing.ExampleMain
+ aj HelloWorld
--To run the example with tracing--
- set ASPECTPATH=../jars/tracingLib.jar
+ set CLASSPATH to include "tracing.jar"
+
+ aj HelloWorld
+
+--To run the example with tracing using ASPECTPATH--
+
+ set ASPECTPATH=tracing.jar
+
+ aj HelloWorld
- aj tracing.ExampleMain
+--To run the example with tracing using an agent--
+ aj5 HelloWorld
diff --git a/docs/dist/doc/examples/ltw/Tracing.aj b/docs/dist/doc/examples/ltw/Tracing.aj
new file mode 100644
index 000000000..29268f348
--- /dev/null
+++ b/docs/dist/doc/examples/ltw/Tracing.aj
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * Matthew Webster initial implementation
+ */
+public aspect Tracing {
+
+ private pointcut mainMethod () :
+ execution(public static void main(String[]));
+
+ before () : mainMethod() {
+ System.out.println("> " + thisJoinPoint);
+ }
+
+ after () : mainMethod() {
+ System.out.println("< " + thisJoinPoint);
+ }
+}