From e1539a531da3192dac843520d77c8c76e407a402 Mon Sep 17 00:00:00 2001 From: lresende Date: Sat, 21 Nov 2009 07:55:07 +0000 Subject: Moving 1.x tags git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@882849 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/samples/sca/helloworld/readme.htm | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 sca-java-1.x/tags/java-M1-20060522/java/samples/sca/helloworld/readme.htm (limited to 'sca-java-1.x/tags/java-M1-20060522/java/samples/sca/helloworld/readme.htm') diff --git a/sca-java-1.x/tags/java-M1-20060522/java/samples/sca/helloworld/readme.htm b/sca-java-1.x/tags/java-M1-20060522/java/samples/sca/helloworld/readme.htm new file mode 100644 index 0000000000..82de419b1c --- /dev/null +++ b/sca-java-1.x/tags/java-M1-20060522/java/samples/sca/helloworld/readme.htm @@ -0,0 +1,54 @@ + + + Tuscany +HelloWorld + +

Tuscany +Hello World Sample

+

Overview

+

The Tuscany helloworld sample shows using the Tuscany SCA +runtime in a J2SE environment  loading a component that +implements the classic introductory hello world example.

+

Location

This +sample is located  in the samples\sca\helloworld directory.

+

Setup

This sample depends on the Tuscany runtime and the sample jar, + + + sample-helloworld-incubating-M1.jar + + +, both of these must be available on the classpath to run the sample. +
    +
+

Running

+ + In the directory samples/sca/helloworld use the JDK 1.5 java command to run the class helloworld.HelloWorldClient + +
Linux: java -cp ../../../lib/tuscany-runtime-incubating-M1.jar:target/sample-helloworld-incubating-M1.jar helloworld.HelloWorldClient
+
Windows: java -cp ../../../lib/tuscany-runtime-incubating-M1.jar;target/sample-helloworld-incubating-M1.jar helloworld.HelloWorldClient
+ +

Results

+

The sample when run should simply display to the standard +output:
Hello World

+

Code Overview

+The source files are physically organized as shown below: +
src
+---main
    +---java
    ¦   +---helloworld
    ¦           HelloWorldClient.java
    ¦           HelloWorldImpl.java
    ¦           HelloWorldService.java
    ¦
    +---resources
            sca.module
+
+ + + + + + + +
sca.moduleDefines the SCA module and component. Defines for the +HelloWorldServiceComponent component  the Java class that +implements that component
HelloWorldService.javaDefines the Java interface implemented by the component.
HelloWorldImpl.javaImplements the SCA component. Uses the SCA service annotation +tag on the class to show what SCA interface is being implemented.
HelloWorldClient.javaCreates a Tuscany runtime and starts it.  Obtains +the module context which was defined by the sca.module file. From the +module context locates the HelloWorldServiceComponent and then +calls  the getGreetings method to invoke the component.

\ No newline at end of file -- cgit v1.2.3