Author: isilval
Date: Fri Sep 14 06:33:41 2007
New Revision: 575673

URL: http://svn.apache.org/viewvc?rev=575673&view=rev
Log:
Add ant script

Added:
    incubator/tuscany/java/sca/samples/implementation-notification/build.xml
    
incubator/tuscany/java/sca/samples/implementation-notification/src/main/java/notification/TrafficAdvisoryClient.java
    
incubator/tuscany/java/sca/samples/implementation-notification/src/main/resources/
    
incubator/tuscany/java/sca/samples/implementation-notification/src/main/resources/TrafficAdvisoryNotification.componentType
    
incubator/tuscany/java/sca/samples/implementation-notification/src/main/resources/TrafficAdvisoryNotification.composite
Modified:
    incubator/tuscany/java/sca/samples/implementation-notification/README

Modified: incubator/tuscany/java/sca/samples/implementation-notification/README
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/implementation-notification/README?rev=575673&r1=575672&r2=575673&view=diff
==============================================================================
--- incubator/tuscany/java/sca/samples/implementation-notification/README 
(original)
+++ incubator/tuscany/java/sca/samples/implementation-notification/README Fri 
Sep 14 06:33:41 2007
@@ -10,6 +10,14 @@
 If you just want to run it to see what happens open a command prompt, navigate
 to this sample directory and do:
 
+ant run
+
+OR if you don't have ant, on Windows do
+
+java -cp 
..\..\lib\tuscany-sca-manifest.jar;target\sample-implementation-notification.jar
 notification.TrafficAdvisoryClient
+
+OR you can also use Maven to test:
+
 mvn test
 
 Sample Overview
@@ -45,6 +53,21 @@
                                                      notification component, 
and consumers
   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-notification
+ant compile
+ant run
+
+You should see the following output from the run target.
+
+run:
+     [java] Consumer [Consumer1] received report: Nothing to report today
+     [java] Consumer [Consumer2] received report: Nothing to report today
+     
 Building And Running The Sample Using Maven 
 -------------------------------------------
 With either the binary or source distributions the sample can be built and run 

Added: incubator/tuscany/java/sca/samples/implementation-notification/build.xml
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/implementation-notification/build.xml?rev=575673&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/implementation-notification/build.xml 
(added)
+++ incubator/tuscany/java/sca/samples/implementation-notification/build.xml 
Fri Sep 14 06:33:41 2007
@@ -0,0 +1,72 @@
+<!--
+ * 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="implementation-notification" default="compile">
+    <property name="test.class" value="notification.TrafficAdvisoryClient" />
+       <property name="test.jar"   
value="sample-implementation-notification.jar" />
+       
+    <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>
+        <jar destfile="target/${test.jar}" basedir="target/classes">
+            <manifest>
+                <attribute name="Main-Class" value="${test.class}" /> 
+            </manifest>
+        </jar>         
+    </target>  
+       
+    <target name="run-classes">
+        <java classname="${test.class}"
+              fork="true">
+            <classpath>
+                <pathelement path="target/classes"/>
+               <pathelement location="../../lib/tuscany-sca-manifest.jar"/>
+            </classpath>
+        </java>
+    </target>
+       
+    <target name="run">
+        <java classname="${test.class}"
+              fork="true">
+            <classpath>
+                <pathelement path="target/${test.jar}"/>
+               <pathelement location="../../lib/tuscany-sca-manifest.jar"/>
+            </classpath>
+        </java>        
+    </target>
+       
+    <target name="clean">
+        <delete quiet="true" includeemptydirs="true">
+            <fileset dir="target"/>
+        </delete>
+    </target>
+</project>

Added: 
incubator/tuscany/java/sca/samples/implementation-notification/src/main/java/notification/TrafficAdvisoryClient.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/implementation-notification/src/main/java/notification/TrafficAdvisoryClient.java?rev=575673&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/samples/implementation-notification/src/main/java/notification/TrafficAdvisoryClient.java
 (added)
+++ 
incubator/tuscany/java/sca/samples/implementation-notification/src/main/java/notification/TrafficAdvisoryClient.java
 Fri Sep 14 06:33:41 2007
@@ -0,0 +1,45 @@
+/*
+ * 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.    
+ */
+package notification;
+
+import notification.TestCaseProducer;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+public class TrafficAdvisoryClient {
+    
+    public static void main(String[] args) throws Exception {
+        try {
+            SCADomain domain = 
SCADomain.newInstance("TrafficAdvisoryNotification.composite");
+            TestCaseProducer testCaseProducer = 
domain.getService(TestCaseProducer.class, "TrafficAdvisoryProducer");
+
+            testCaseProducer.produceTrafficNotification("Nothing to report 
today");
+
+            domain.close();
+        } catch(Throwable e) {
+            e.printStackTrace();
+            if (e instanceof Exception) {
+                throw (Exception)e;
+            }
+            else {
+                throw new Exception(e);
+            }
+        }
+    }
+}

Added: 
incubator/tuscany/java/sca/samples/implementation-notification/src/main/resources/TrafficAdvisoryNotification.componentType
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/implementation-notification/src/main/resources/TrafficAdvisoryNotification.componentType?rev=575673&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/samples/implementation-notification/src/main/resources/TrafficAdvisoryNotification.componentType
 (added)
+++ 
incubator/tuscany/java/sca/samples/implementation-notification/src/main/resources/TrafficAdvisoryNotification.componentType
 Fri Sep 14 06:33:41 2007
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * 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.    
+-->
+
+<componentType xmlns="http://www.osoa.org/xmlns/sca/1.0"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
+     <service name="TrafficAdvisoryNotificationService">
+           <interface.java interface="notification.TrafficAdvisory"/>
+     </service>
+
+     <reference name="TrafficAdvisoryNotificationReference"
+                multiplicity="0..n">
+           <interface.java interface="notification.TrafficAdvisory"/>
+     </reference>
+</componentType>

Added: 
incubator/tuscany/java/sca/samples/implementation-notification/src/main/resources/TrafficAdvisoryNotification.composite
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/implementation-notification/src/main/resources/TrafficAdvisoryNotification.composite?rev=575673&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/samples/implementation-notification/src/main/resources/TrafficAdvisoryNotification.composite
 (added)
+++ 
incubator/tuscany/java/sca/samples/implementation-notification/src/main/resources/TrafficAdvisoryNotification.composite
 Fri Sep 14 06:33:41 2007
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * 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.    
+-->
+
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
+           xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0";
+           targetNamespace="http://sample";
+           xmlns:sample="http://sample";
+           name="TrafficAdvisoryNotificationLocalComposite">
+
+    <component name="TrafficAdvisoryProducer">
+        <implementation.java class="notification.TrafficAdvisoryProducer"/>
+        <reference name="destination" 
target="TrafficAdvisoryNotificationComponent"/>
+    </component>
+
+    <component name="TrafficAdvisoryNotificationComponent">
+        <tuscany:implementation.notification 
name="TrafficAdvisoryNotification"/>
+        <!-- Never use > 1 reference elements here !! -->
+        <reference name="TrafficAdvisoryNotificationReference"
+                   multiplicity="0..n"
+                   target="TrafficAdvisoryConsumer1 TrafficAdvisoryConsumer2"/>
+    </component>
+
+    <component name="TrafficAdvisoryConsumer1">
+        <implementation.java class="notification.TrafficAdvisoryConsumer"/>
+        <property name="name">Consumer1</property>
+    </component>
+
+    <component name="TrafficAdvisoryConsumer2">
+        <implementation.java class="notification.TrafficAdvisoryConsumer"/>
+        <property name="name">Consumer2</property>
+    </component>
+
+</composite>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to