The Tuscany SCA Java Project
This page provides a high-level overview of the Java SCA (Service Component Architecture) subproject of the Apache Tuscany incubator project.
Packaging / Partitioning
SPI <<about the SPI >>
Core <<about what goes into the core, mentioning about extension points etc. >>
Containers <<about container extensions>>
Bindings <<about binding extensions>>
Design & Implementation
<<Covers the major components / features of tuscany - the runtime launching, Modularity - the extension Model (Loaders, Builders, Invokers...)>>
- a loader that handles extension-specific XML elements
- a builder that creates extension-specific components
- the runtime components that hook into the wiring fabric
Each extension is packaged as a composite which can be <included> in another or which can be deployed into the system. When the composite starts, all the components it contains register themselves with the appropriate registries in the runtime (e.g. the LoaderRegistry).
<<this section will contain information about the various distributions (fall out of the discussions on Modularity currently going on in the Mailing Lists>>
Downloading and Installing
<<should have contents that ideally point to the Apache Tuscany Website>>
- The samples demonstrate the deployment of one or more service components into the SCA Runtime, then finding them and invoking service methods on them. The responsibility of bringing up the runtime, loading it with components defined in various scdls and finally deploying them as Service Components (runtime artifacts) in abstracted into the Launcher. Hence to test a sample service component, the first step would be to start the launcher.
Tescases in Samples
- The testcases of SCA Samples extend from SCATestCase which starts the Launcher as part of the test setup. Thus before the testcases are actually executed the Laucher is started and it handles the booting of the SCA Runtime, loading of system components as well as the application components (spread across various scdl files). Hence the sample testcases simply deal with obtaining a runtime context, locating the service component being tested and invoking service methods on them.
Running Samples from within IDE
Download the source code from https://svn.apache.org/repos/asf/incubator/tuscany/java and build the distribution. This will create <Tuscany Codebase>\distribution\sca\standalone\target with two files standalone-1.0-SNAPSHOT-bin.tar.gz and standalone-1.0-SNAPSHOT-bin.zip.
Unpack say standalone-1.0-SNAPSHOT-bin.zip, if you are working on windows, to some location on your machine for example c:\Tuscany_Standalone.
A more detailed set of steps was contributed by Francesco in our user mailling list :
- 1.build the SCA Source Distribution from the source 2.generate eclipse projects (mvn -PEclipse eclipse:eclipse) 3.build the Samples (unpacking the Tuscany standalone server as indicated) 4.generate eclipse projects 5.import SCA and Samples projects in Eclipse 6.add the "target\distribution\bin\launcher.jar" to the build path of the sample-calculator project (right-click on the jar) 7.create a new Java Application configuration to launch the sample
7.1 (Main Tab) select the "org.apache.tuscany.launcher.MainLauncherBooter" or "org.apache.tuscany.launcher.Main" if you are using trunk class of the target\distribution\bin\launcher.jar as Main class (checking "Includes libraries when searching for a main class") 7.2 (Arguments Tab) add "target/sample-calculator.jar" as Program Argument 7.3 (Source Tab) add all the SCA M2 eclipse projects as sources
Running Samples from within IDEA & Eclipse
Create a junit configuration for e.g. CalculatorTestCase
- Edit that configuration to set the system property "-Dtuscany.installDir=c:\Tuscany_Standalone"
- Run or Debug that configuration
$ java -Xdebug -Xnoagent -Djava.compiler=NONE - Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 -jar bin/launcher.jar ~/.m2/repository/org/apache/tuscany/samples/ sca/sample-localwire/1.0-SNAPSHOT/sample-localwire-1.0-SNAPSHOT.jar
and then attach to the suspended process.
<< lists the samples that are there in SCA and the features that they demonstrate >>
See Getting Started for a first pass at a Getting Started guide for Tuscany SCA Java M2.