You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sl...@apache.org on 2007/05/09 19:55:27 UTC
svn commit: r536602 - in
/incubator/tuscany/java/sca/samples/implementation-composite: README
build.xml readme.html
Author: slaws
Date: Wed May 9 10:55:27 2007
New Revision: 536602
URL: http://svn.apache.org/viewvc?view=rev&rev=536602
Log:
add ant build and readme material
Added:
incubator/tuscany/java/sca/samples/implementation-composite/README (with props)
incubator/tuscany/java/sca/samples/implementation-composite/build.xml (with props)
Removed:
incubator/tuscany/java/sca/samples/implementation-composite/readme.html
Added: incubator/tuscany/java/sca/samples/implementation-composite/README
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/implementation-composite/README?view=auto&rev=536602
==============================================================================
--- incubator/tuscany/java/sca/samples/implementation-composite/README (added)
+++ incubator/tuscany/java/sca/samples/implementation-composite/README Wed May 9 10:55:27 2007
@@ -0,0 +1,89 @@
+Calculator Sample
+=================
+
+This sample shows how composite can be used to implement components.
+
+The README in the samples directory (the directory above this) provides
+general instructions about building and running samples. Take a look there
+first.
+
+Sample Overview
+---------------
+
+The sample is comprised of three composites. Take a look at the composite file
+or the .svg/.png file which shows the composite file in pictorial form. The
+OuterComposite defines three components two of which are implemented using
+composites. The SourceComponent calls each TargetComponent in turn. There is a
+callback which returns from each TargetComponent to the SourceComponent.
+
+calculator/
+ src/
+ main/
+ java/
+ composite/
+ Source.java - interface for the source component
+ SourceCallback.java - souce component callback interface
+ Target.java - interfact for the target component
+ etc.
+ CompositeClient.java - starts the SCA Runtime and
+ deploys the OuterComposite.composite.
+ This in turn pulls in the two inner
+ composites
+ resources/
+ OuterComposite.composite - the top level SCA assembly for this sample
+ InnerComposite.composite - included by OuterComposite.composite
+ InnerComposite2.composite - included by OuterComposite.composite
+ implementation-composite.png - a pictorial representation of the sample
+ .composite file
+ build.xml - the Ant build file
+ pom.xml - the Maven build file
+
+Building And Running The Sample Using Ant
+-----------------------------------------
+With the binary distribution the sample can be built and run using Ant as
+follows
+
+cd implementation-composite
+ant
+
+You should see the following output from the run target.
+
+run:
+ [java] Main thread Thread[main,5,main]
+ [java] Source: Client.main -> Source.clientMethod
+ [java] Source: Client.main => Source.clientMethod2
+ [java] Sleeping ...
+ [java] Target: Client.main -> Source.clientMethod
+ [java] Work thread Thread[pool-1-thread-1,5,main]
+ [java] Result: Client.main -> Source.clientMethod -> Target.someMethod
+ [java] Target: Client.main => Source.clientMethod2
+
+Building And Running The Sample Using Maven
+-------------------------------------------
+With either the binary or source distributions the sample can be built and run
+using Maven as follows.
+
+cd implementation-composite
+mvn
+
+You should see the following output from the test phase.
+
+-------------------------------------------------------
+ T E S T S
+-------------------------------------------------------
+Running composite.CompositeTestCase
+Main thread Thread[main,5,main]
+Source: Client.main -> Source.clientMethod
+Source: Client.main => Source.clientMethod2
+Sleeping ...
+Target: Client.main -> Source.clientMethod
+Work thread Thread[pool-1-thread-1,5,main]
+Result: Client.main -> Source.clientMethod -> Target.someMethod
+Target: Client.main => Source.clientMethod2
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.374 sec
+
+Results :
+
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
+
+This shows that the Junit test cases have run successfully.
Propchange: incubator/tuscany/java/sca/samples/implementation-composite/README
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/samples/implementation-composite/README
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/tuscany/java/sca/samples/implementation-composite/build.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/implementation-composite/build.xml?view=auto&rev=536602
==============================================================================
--- incubator/tuscany/java/sca/samples/implementation-composite/build.xml (added)
+++ incubator/tuscany/java/sca/samples/implementation-composite/build.xml Wed May 9 10:55:27 2007
@@ -0,0 +1,56 @@
+<!--
+ * 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.
+-->
+<project name="sample-calculator" default="run">
+ <property environment="env"/>
+
+ <target name="init">
+ <mkdir dir="target/classes"/>
+ </target>
+
+ <target name="compile" depends="init">
+ <javac srcdir="src/main/java"
+ destdir="target/classes"
+ debug="on"
+ source="1.5"
+ target="1.5">
+ <classpath>
+ <pathelement location="../../lib/tuscany-sca-manifest.jar"/>
+ </classpath>
+ </javac>
+ <copy todir="target/classes">
+ <fileset dir="src/main/resources"/>
+ </copy>
+ </target>
+
+ <target name="run" depends="compile">
+ <java classname="composite.CompositeClient"
+ fork="true">
+ <classpath>
+ <pathelement path="target/classes"/>
+ <pathelement location="../../lib/tuscany-sca-manifest.jar"/>
+ </classpath>
+ </java>
+ </target>
+
+ <target name="clean">
+ <delete quiet="true" includeemptydirs="true">
+ <fileset dir="target"/>
+ </delete>
+ </target>
+</project>
Propchange: incubator/tuscany/java/sca/samples/implementation-composite/build.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/samples/implementation-composite/build.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/tuscany/java/sca/samples/implementation-composite/build.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org