Tuscany SamplesThe Tuscany Samples are shipped with Tuscany binary and source releases. If you are using tuscany from a release distribution then make sure you are looking at the documentation that corresponds to the samples as they stood at the time of the release ... [2.0-beta-Samples documentation|2.0-beta-Samples documentation]If however you are working with a snapshot distribution, or using samples code from the trunk of our source repository, then you've come to the right place, as the documentation here reflects the curtrent status of the samples in the trunk of our source tree. In a distribution, the samples source code is found in either a binary or source code distribution in the samples directory, directly under the root directory. The following sections are laid out to match the structure of the samples directory and its subdirectories. getting-startedThe basic package of SCA application artifacts is a contribution which for this simple sample is found in contribution-helloworld. There's also a directory which contains all you need to make a web application archive which can be deployed to a web container such as Tomcat, so that the sayHello service can be run in the web container. contribution-helloworldThis contribution contains Java implementation code offering the service String sayHello(String name), where the immplementation of the service In this folder you'll find the simplest contribution, implemented in Java, that implements the "business logic" of saying hello to a person whose name is supplied as input to the service. helloworld-webapp(TODO It's not at all clear how this is supposed to work once it is in the web container - I have asked on the dev list) running-tuscanyRunning something in Tuscany requires one or more contributions, and a method of launching the contributions to make them available as services. In the sections below is described various means of launching contributions into an executing tuscany runtime. launcher-command-lineTo execute a sample contribution from the command line on Windows, from a command prompt in the samples directory, run the command ... ..\bin\tuscany.bat "contribution-name" for example ..\bin\tuscany.bat contribution-binding-sca-calculator or on *nix platforms, from a shell prompt in the samples directory, run the command ... ../bin/tuscany.sh contribution-binding-sca-calculator launcher-embedded-jseThis directory contains sample java launchers for the ant run-<contributionname> where run-<contributionname> is one of the targets in the build.xml file To use this sample launcher to run all of the contributions as junit test cases, execute the command "mvn" in the launcher directory. launcher-embedded-osgiThe launchers implemented in the src/main/java/launchers directory each launch a specific contribution into the OSGI runtime. ant run-<contributionname> where run-<contributionname> is one of the targets in the build.xml file To use this sample launcher to run all of the contributions as junit test cases, mvn in the launcher directory. launcher-mavenTo execute a sample contribution from Maven look for contributions that have the following configuration in their pom.xml file: <plugin> For contributions that have this, for example, learning-more/binding-sca/contribution-calculator, do the following cd samples/learning-more/binding-sca/contribution-calculator This will launch the contribution in the Tuscany runtime and then wait. At this point you can use launcher-osgiThe Tuscany runtime can be run in and OSGi container. Running in Equinox ------------------ On Windows, run java \-jar ..\..\modules\osgi-3.5.0-v20090520.jar \-configuration ..\..\features\configuration \-clean \-console On *Unix, run java \-jar ../../modules/osgi-3.5.0-v20090520.jar \-configuration ../../features/configuration \-clean \-console You should see the osgi console: osgi> osgi> Jun 22, 2009 1:32:27 PM org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoveryActivator start INFO: Equinox-based service discoverer is now configured. You can run "ss" command under the osgi> to see the status of the bundles. osgi> ss Then you can install and start contributions as bundles by doing the following: osgi> install file:./path/to/contribution_bundle.jar Note that contribution_bundle.jar will need an activator in order to register the bundle as a SCA contribution see samples/???? TODO is this still true Running on Felix See http://tuscany.apache.org/documentation-2x/running-tuscany-sca-2x-with-equinox-and-felix.html launcher-shelllauncher-webapplearning-morecontributionshelloworld-bpelhelloworld-recursivehelloworld-recursive-wshelloworld-scaclienthelloworld-springhelloworld-ws-sdowebappshelloworld-bpelhelloworld-jaxrshelloworld-jmshelloworld-js-clienthelloworld-jsfhelloworld-jsphelloworld-servlethelloworld-springhelloworld-stripes== asyncembedded-jse-async-sample-launchersample-contribution-implementation-java-calculator-asyncbinding-cometbinding-jsonrpccontribution-calculatorcontribution-calculator-webappbinding-rmicontribution-calculator-referencecontribution-calculator-servicebinding-scacontribution-calculatorbinding-wscontribution-calculatordistributed-osgidynamicdosgi-dynamic-calculatordosgi-dynamic-calculator-operationsimplementation.osgidosgi-calculatordosgi-calculator-operationsimplementation-extensionimplementation-javacontribution-calculatorimplementation-scriptcontribution-calculatorlogging-scribemaven-osgi-junitcalculator-osgicalculator-rest-osgisca-clientcalculator-scaclientapplicationsstorestore-webapp |