diff options
author | kelvingoodson <kelvingoodson@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-31 16:03:35 +0000 |
---|---|---|
committer | kelvingoodson <kelvingoodson@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-31 16:03:35 +0000 |
commit | 32f40c3401ff70222df0d8359b733b36b455f617 (patch) | |
tree | 811ec10d7ab2f2c471c17ef272252de5d76445b3 | |
parent | e6e014cb71ac33687bbd3af4bb75840c5767edaf (diff) |
add tracing capability into distribution and extend calculator sample to demonstrate tracing
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@929603 13f79535-47bb-0310-9956-ffa450edef68
11 files changed, 96 insertions, 6 deletions
diff --git a/sca-java-2.x/trunk/distribution/all/pom.xml b/sca-java-2.x/trunk/distribution/all/pom.xml index 42679555da..2892c8fbb0 100644 --- a/sca-java-2.x/trunk/distribution/all/pom.xml +++ b/sca-java-2.x/trunk/distribution/all/pom.xml @@ -62,6 +62,16 @@ <artifactId>tuscany-implementation-web-client</artifactId> <version>2.0-SNAPSHOT</version> </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-tracing-aspectj</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>aspectjweaver</artifactId> + <version>1.6.2</version> + </dependency> </dependencies> <profiles> diff --git a/sca-java-2.x/trunk/distribution/all/src/main/assembly/bin-default.xml b/sca-java-2.x/trunk/distribution/all/src/main/assembly/bin-default.xml index 2f78f57aa1..871c483808 100644 --- a/sca-java-2.x/trunk/distribution/all/src/main/assembly/bin-default.xml +++ b/sca-java-2.x/trunk/distribution/all/src/main/assembly/bin-default.xml @@ -31,5 +31,6 @@ <componentDescriptor>src/main/components/bin-modules.xml</componentDescriptor> <componentDescriptor>src/main/components/bin-samples.xml</componentDescriptor> <componentDescriptor>src/main/components/bin-launcher.xml</componentDescriptor> + <componentDescriptor>src/main/components/bin-tracing.xml</componentDescriptor> </componentDescriptors> </assembly> diff --git a/sca-java-2.x/trunk/distribution/all/src/main/components/bin-modules.xml b/sca-java-2.x/trunk/distribution/all/src/main/components/bin-modules.xml index 89de329d86..b41a7e0260 100644 --- a/sca-java-2.x/trunk/distribution/all/src/main/components/bin-modules.xml +++ b/sca-java-2.x/trunk/distribution/all/src/main/components/bin-modules.xml @@ -26,6 +26,9 @@ <include>modules/**/*</include> <include>features/**/*</include> </includes> + <excludes> + <exclude>org.aspectj:aspectjweaver</exclude> + </excludes> </fileSet> </fileSets> diff --git a/sca-java-2.x/trunk/distribution/all/src/main/components/bin-tracing.xml b/sca-java-2.x/trunk/distribution/all/src/main/components/bin-tracing.xml new file mode 100644 index 0000000000..0f272dda24 --- /dev/null +++ b/sca-java-2.x/trunk/distribution/all/src/main/components/bin-tracing.xml @@ -0,0 +1,41 @@ +<!-- + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. +--> +<component> + <fileSets> + <fileSet> + <directory>src/main/release/tracing</directory> + <outputDirectory>bin</outputDirectory> + <includes> + </includes> + </fileSet> + </fileSets> + + <dependencySets> + <dependencySet> + <outputDirectory>bin</outputDirectory> + <unpack>false</unpack> + <includes> + <include>org.aspectj:aspectjweaver</include> + </includes> + <outputFileNameMapping>aspectjweaver.jar</outputFileNameMapping> + </dependencySet> + + </dependencySets> + +</component> diff --git a/sca-java-2.x/trunk/features/all/pom.xml b/sca-java-2.x/trunk/features/all/pom.xml index 52747db777..994023c63a 100644 --- a/sca-java-2.x/trunk/features/all/pom.xml +++ b/sca-java-2.x/trunk/features/all/pom.xml @@ -101,6 +101,12 @@ <version>2.0-SNAPSHOT</version> </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-tracing-aspectj</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + </dependencies> </project> diff --git a/sca-java-2.x/trunk/modules/pom.xml b/sca-java-2.x/trunk/modules/pom.xml index c19fc74e7b..a689391ca3 100644 --- a/sca-java-2.x/trunk/modules/pom.xml +++ b/sca-java-2.x/trunk/modules/pom.xml @@ -115,6 +115,7 @@ <module>sca-client-impl</module> <module>sca-client-javascript</module> <module>stripes</module> + <module>tracing-aspectj</module> <module>xsd</module> <module>web-javascript</module> <module>web-javascript-dojo</module> diff --git a/sca-java-2.x/trunk/modules/tracing-aspectj/pom.xml b/sca-java-2.x/trunk/modules/tracing-aspectj/pom.xml index f0a1136285..ead39cbdfd 100644 --- a/sca-java-2.x/trunk/modules/tracing-aspectj/pom.xml +++ b/sca-java-2.x/trunk/modules/tracing-aspectj/pom.xml @@ -50,7 +50,7 @@ <build> <plugins> <!-- Copy the aspectjweaver jar to avoid surefire problems for - directorites with space --> + directories with space --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> diff --git a/sca-java-2.x/trunk/modules/tracing-aspectj/src/main/resources/META-INF/aop.xml b/sca-java-2.x/trunk/modules/tracing-aspectj/src/main/resources/META-INF/aop.xml index 8bbbf52121..b7f629ff4f 100644 --- a/sca-java-2.x/trunk/modules/tracing-aspectj/src/main/resources/META-INF/aop.xml +++ b/sca-java-2.x/trunk/modules/tracing-aspectj/src/main/resources/META-INF/aop.xml @@ -21,8 +21,8 @@ <aspects> <!-- Uncomment either of these two aspects to perform standard logging --> <!-- or standard tracing on the Tuscany runtime. --> - <!-- <aspect name="org.apache.tuscany.sca.aspectj.SimpleTracingAspect" /> --> - <!-- <aspect name="org.apache.tuscany.sca.aspectj.LoggingAspect" /> --> + <aspect name="org.apache.tuscany.sca.aspectj.SimpleTracingAspect" /> + <aspect name="org.apache.tuscany.sca.aspectj.LoggingAspect" /> <!-- Following is a concrete-aspect that defines the point cut for --> <!-- the TimingAspect. Which ever calls you define in this pointcut --> diff --git a/sca-java-2.x/trunk/samples/README b/sca-java-2.x/trunk/samples/README index 4ccefa3695..0d83dccd8d 100644 --- a/sca-java-2.x/trunk/samples/README +++ b/sca-java-2.x/trunk/samples/README @@ -24,8 +24,9 @@ and the extensions that come packaged with it. binding-ws-calculator - Calculator running inside a web app also showing webservices binding -calculator - Calculator built with java components and - local wires. +calculator (also traced) - Calculator built with java components and + local wires. A second build target shows how to + execute the sample with Tuscany trace turned on. calculator-equinox - Calculator running inside a Equinox OSGi runtime diff --git a/sca-java-2.x/trunk/samples/calculator/README b/sca-java-2.x/trunk/samples/calculator/README index 56c22d9c89..7ce753b0aa 100644 --- a/sca-java-2.x/trunk/samples/calculator/README +++ b/sca-java-2.x/trunk/samples/calculator/README @@ -1,6 +1,6 @@ Calculator Sample ================= -This sample implements a simple calculator using SCA components. +This sample implements a simple calculator using SCA components. It also optionally demonstrates tracing Tuscany code. The README in the samples directory (the directory above this) provides general instructions about building and running samples. Take a look there @@ -19,6 +19,18 @@ and on *nix do java -cp ../../features/tuscany-sca-manifest.jar:target/sample-calculator.jar calculator.CalculatorClient +If you want to see an example of tracing the Tuscany code ... then try the command +--------------------------------------------------------- +ant runtraced + +or on Windows run the command + +java -javaagent:../../bin/aspectjweaver.jar -cp ..\..\features\tuscany-sca-manifest.jar;target\sample-calculator.jar calculator.CalculatorClient + +or on *nix run the command + +java -javaagent:../../bin/aspectjweaver.jar -cp ..\..\features\tuscany-sca-manifest.jar:target\sample-calculator.jar calculator.CalculatorClient + Sample Overview --------------- The sample provides a single calculator service with a default SCA (java) diff --git a/sca-java-2.x/trunk/samples/calculator/build.xml b/sca-java-2.x/trunk/samples/calculator/build.xml index 4411cae659..69704c3a51 100644 --- a/sca-java-2.x/trunk/samples/calculator/build.xml +++ b/sca-java-2.x/trunk/samples/calculator/build.xml @@ -21,6 +21,8 @@ <property name="jar.name" value="sample-calculator.jar" /> <property name="main.class" value="calculator.CalculatorClient" /> + <property name="aspectjweaver" value="../../bin/aspectjweaver.jar"/> + <property name="manifestjar" value="../../features/tuscany-sca-manifest.jar"/> <target name="compile" depends="init"> <javac srcdir="src/main/java" destdir="target/classes" debug="on" source="1.5" target="1.5"> @@ -60,6 +62,19 @@ </java> </target> + <target name="runtraced" depends="compile"> + <java classname="calculator.CalculatorClient" + fork="true" + failonerror="true"> + <classpath> + <pathelement location="${manifestjar}"></pathelement> + <pathelement location="target/${jar.name}"></pathelement> + </classpath> + <jvmarg value="-javaagent:${aspectjweaver}"/> + <arg value="unmanaged"/> + <arg value="target/${jar.name}"/> + </java> + </target> </project> |