You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by is...@apache.org on 2007/09/14 16:58:40 UTC

svn commit: r575713 - in /incubator/tuscany/java/sca/samples: binding-notification-consumer/ binding-notification-consumer/src/main/java/notification/consumer/ binding-notification-producer/

Author: isilval
Date: Fri Sep 14 07:58:39 2007
New Revision: 575713

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

Added:
    incubator/tuscany/java/sca/samples/binding-notification-consumer/build.xml
Modified:
    incubator/tuscany/java/sca/samples/binding-notification-consumer/README
    incubator/tuscany/java/sca/samples/binding-notification-consumer/src/main/java/notification/consumer/TrafficAdvisoryServer.java
    incubator/tuscany/java/sca/samples/binding-notification-producer/build.xml

Modified: incubator/tuscany/java/sca/samples/binding-notification-consumer/README
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/binding-notification-consumer/README?rev=575713&r1=575712&r2=575713&view=diff
==============================================================================
--- incubator/tuscany/java/sca/samples/binding-notification-consumer/README (original)
+++ incubator/tuscany/java/sca/samples/binding-notification-consumer/README Fri Sep 14 07:58:39 2007
@@ -26,6 +26,23 @@
 component's <implementation.notification/>. This allows messages sent and received
 via <binding.notification/> to be transported as literal xml over http.
 
+Building And Running The Sample Using Ant
+-----------------------------------------
+With the binary distribution the sample can be built and run using Ant as 
+follows
+
+cd binding-notification-consumer
+ant compile
+ant run
+
+You should see the following output from the run target.
+
+run:
+     [java] Sep 14, 2007 10:56:29 AM org.apache.tuscany.sca.http.jetty.JettyServer addServletMapping
+     [java] INFO: Added Servlet mapping: http://localhost:8083/ntm/trafficAdvisory
+     [java] Sep 14, 2007 10:56:29 AM org.apache.tuscany.sca.http.jetty.JettyServer addServletMapping
+     [java] INFO: Added Servlet mapping: http://localhost:8083/consumer/trafficAdvisory
+     
 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/binding-notification-consumer/build.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/binding-notification-consumer/build.xml?rev=575713&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/binding-notification-consumer/build.xml (added)
+++ incubator/tuscany/java/sca/samples/binding-notification-consumer/build.xml Fri Sep 14 07:58:39 2007
@@ -0,0 +1,76 @@
+<!--
+ * 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="binding-notification-consumer" default="compile">
+    <property name="test.class" value="notification.consumer.TrafficAdvisoryServer" />
+	<property name="test.jar"   value="sample-binding-notification-consumer.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>
+        	<sysproperty key="notification.httpPort" value="8083"/>
+        	<arg value="end"/>
+        </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>
+        	<sysproperty key="notification.httpPort" value="8083"/>
+        	<arg value="end"/>
+        </java>    	
+    </target>
+	
+    <target name="clean">
+        <delete quiet="true" includeemptydirs="true">
+            <fileset dir="target"/>
+        </delete>
+    </target>
+</project>

Modified: incubator/tuscany/java/sca/samples/binding-notification-consumer/src/main/java/notification/consumer/TrafficAdvisoryServer.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/binding-notification-consumer/src/main/java/notification/consumer/TrafficAdvisoryServer.java?rev=575713&r1=575712&r2=575713&view=diff
==============================================================================
--- incubator/tuscany/java/sca/samples/binding-notification-consumer/src/main/java/notification/consumer/TrafficAdvisoryServer.java (original)
+++ incubator/tuscany/java/sca/samples/binding-notification-consumer/src/main/java/notification/consumer/TrafficAdvisoryServer.java Fri Sep 14 07:58:39 2007
@@ -32,8 +32,10 @@
             SCADomain domain = SCADomain.newInstance("TrafficAdvisoryNotification.composite");
 
             try {
-                System.out.println("TrafficAdvisoryServer, hit return to end");
-                System.in.read();
+                if (args.length != 1 || !args[0].equals("end")) {
+                    System.out.println("TrafficAdvisoryServer, hit return to end");
+                    System.in.read();
+                }
             } catch (IOException e) {
                 e.printStackTrace();
             }

Modified: incubator/tuscany/java/sca/samples/binding-notification-producer/build.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/binding-notification-producer/build.xml?rev=575713&r1=575712&r2=575713&view=diff
==============================================================================
--- incubator/tuscany/java/sca/samples/binding-notification-producer/build.xml (original)
+++ incubator/tuscany/java/sca/samples/binding-notification-producer/build.xml Fri Sep 14 07:58:39 2007
@@ -51,6 +51,8 @@
                 <pathelement path="target/classes"/>
             	<pathelement location="../../lib/tuscany-sca-manifest.jar"/>
             </classpath>
+        	<sysproperty key="notification.httpPort" value="8083"/>
+        	<arg value="end"/>
         </java>
     </target>
 	



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org