tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsdelf...@apache.org
Subject svn commit: r567603 - in /incubator/tuscany/java/sca/samples/web-resource: README build.xml
Date Mon, 20 Aug 2007 08:47:36 GMT
Author: jsdelfino
Date: Mon Aug 20 01:47:35 2007
New Revision: 567603

URL: http://svn.apache.org/viewvc?rev=567603&view=rev
Log:
Added readme and build.xml to sample.

Added:
    incubator/tuscany/java/sca/samples/web-resource/README   (with props)
    incubator/tuscany/java/sca/samples/web-resource/build.xml   (with props)

Added: incubator/tuscany/java/sca/samples/web-resource/README
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/web-resource/README?rev=567603&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/web-resource/README (added)
+++ incubator/tuscany/java/sca/samples/web-resource/README Mon Aug 20 01:47:35 2007
@@ -0,0 +1,72 @@
+Web Resource Component Sample
+======================================
+This sample demonstrates an SCA Web resource component.
+
+The README in the samples directory (the directory above this) provides 
+general instructions about building and running samples. Take a look there 
+first. 
+
+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-web-resource.jar web.resource.SampleServer
+
+and on *nix do
+
+java -cp ../../lib/tuscany-sca-manifest.jar:target/sample-web-resource.jar web.resource.SampleServer
+
+Now the server is started you can point your Web browser to the URL of the Web resource.
+
+Sample Overview
+---------------
+The sample provides a single component exposing a Web resource.
+
+web-resource/
+  src/
+    main/
+      java/
+        web/resource/
+          SampleServer.java               - starts the SCA Runtime and 
+                                            deploys the WebResource.composite
+      resources/
+        myContent/
+          index.html                      - a Web HTML resource
+        WebResource.composite             - the SCA assembly for this sample
+  web-resource.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 using the 
+following commands
+
+cd web-resource
+ant compile
+ant run
+
+You should see the following output from the run target.
+
+run:
+    [java] Added Servlet mapping: http://localhost:8080/myWeb/*
+    [java] Sample server started (press enter to shutdown)
+
+    [java] To get the Web resource, point your Web browser to the following address:
+    [java] http://localhost:8080/MyWeb/index.html
+     
+As this point the Web resource is exposed by a web server started automatically
+by the SCA runtime. To stop the server just press enter.
+
+Building The Sample Using Maven 
+-------------------------------------------
+With either the binary or source distributions the sample can be built using
+Maven as follows.
+
+cd web-resource
+mvn
+

Propchange: incubator/tuscany/java/sca/samples/web-resource/README
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/samples/web-resource/README
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/samples/web-resource/build.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/web-resource/build.xml?rev=567603&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/web-resource/build.xml (added)
+++ incubator/tuscany/java/sca/samples/web-resource/build.xml Mon Aug 20 01:47:35 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="web-resource" default="compile">
+    <property name="test.class" value="web.resource.SampleServer" />
+	<property name="test.jar"   value="sample-web-resource.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>

Propchange: incubator/tuscany/java/sca/samples/web-resource/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/samples/web-resource/build.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date



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


Mime
View raw message