Tuscany Inner Composite Sample

Overview

The Tuscany Inner Composite sample illustrates an asynchronous callback scenario across atomic components contained in separate composites. The containing (inner) composites are themselves contained in a single composite and an explicit wire connects them. Thus, the corresponding composite reference and service do not specify a binding (not even binding.sca), and the connection and invocation occur in the same process.

Location

This sample is located  in the samples\standalone\inner.composite directory. All the following commands should be issued while working in the sample directory.

Prerequisites

Obtain the following prerequisites and install according to their documentation.

Building

To build the sample  issue :

mvn

The result after executing is in the target subdirectory the sample-innercomposite.jar

Setup

Set up the Tuscany standalone runtime environment using the following command:

mvn dependency:unpack 

After completion there should be a target\distribution subdirectory created that has the Tuscany standalone runtime.

Running

Execute the following command: (cut and paste to command line)

java -jar target/distribution/bin/launcher.jar target/sample-innercomposite.jar

Results

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

Main thread Thread[main,5,main]
Source: Client.main -> Source.clientMethod
Source: Client.main => Source.clientMethod
Target: Client.main => Source.clientMethod
Work thread Thread[pool-1-thread-2,5,main]
Result: Client.main => Source.clientMethod -> Target.someMethod
Target: Client.main -> Source.clientMethod
Work thread Thread[pool-1-thread-3,5,main]
Result: Client.main -> Source.clientMethod -> Target.someMethod