...
Running 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.
...
command-line
To execute a sample contribution from the command line on Windows, from a command prompt in the samples directory, run the command ...
...
Code Block |
---|
../bin/tuscany.sh contribution-binding-sca-calculator |
...
embedded-jse
This directory contains sample java launchers for the
tuscany sample contributions. To use the sample JSE launchers with ant execute the command
...
To use this sample launcher to run all of the contributions as junit test cases, execute the command "mvn" in the launcher directory.
...
embedded-osgi
The launchers implemented in the src/main/java/launchers directory each launch a specific contribution into the OSGI runtime.
To use this sample OSGI launcher with ant excute the command
...
in the launcher directory.
...
maven
To execute a sample contribution from Maven
...
This will launch the contribution in the Tuscany runtime and then wait. At this point you can use
other clients to send messages to services that the running SCA applcation exposes,
for example, try learning-more/calculator-scaclient.
...
osgi
The Tuscany runtime can be run in and OSGi container.
...
See http://tuscany.apache.org/documentation-2x/running-tuscany-sca-2x-with-equinox-and-felix.html
...
shell
This directory contains a sample shell program supporting simple commands to
start and stop SCA composites.
...
The shell can also run as a Webapp. To try it install target/scashell.war in
a Web container, point your Web browser to http://localhost:8080/scashell
and try the links on that page.
...
webapp
To execute sample webapp based contributions (contributions that have webapp at the end of their name) you
can build the contribution using maven and then copy the resulting war file to your container of choice
...
The samples found in the contributions below illustrate how to see more of SCA and Tuscany's features in action.
...
async
Note | ||
---|---|---|
|
...
document |
embedded-jse-async-sample-launcher
sample-contribution-implementation-java-calculator-async
binding-comet
Note | ||
---|---|---|
| ||
check instructions work and fix up |
This sample demonstrates an SCA service implemented by a BPEL process.
If you just want to run it to see what happens open a command prompt, navigate
to this sample directory, and do
Code Block |
---|
ant compile run
|
OR if you don't have ant, on Windows do
Understand and Document |
binding-jsonrpc
Note | ||
---|---|---|
| ||
Understand and Document |
contribution-calculator
Note | ||
---|---|---|
| ||
Understand and Document |
contribution-calculator-webapp
Note | ||
---|---|---|
| ||
Understand and Document |
binding-rmi
In this example the caluclator function is split over two contyributions in order to demonstrate the remote method invocation binding.
Note | ||
---|---|---|
| ||
Document |
contribution-calculator-reference
Note | ||
---|---|---|
| ||
Document |
contribution-calculator-service
Note | ||
---|---|---|
| ||
Document |
binding-sca
Note | ||
---|---|---|
| ||
Understand and Document |
contribution-calculator
Note | ||
---|---|---|
| ||
Understand and Document |
binding-ws
Note | ||
---|---|---|
| ||
Understand and Document |
contribution-calculator
contribution-helloworld-ws-sdo
Note | ||
---|---|---|
| ||
Understand and Document |
distributed-osgi
These samples demonstrate the execution of Tuscany contributions in a distributed OSGI environment.
dynamic
The OSGI samples in this section dynamically configure of the OSGI environment.
dosgi-dynamic-calculator
dosgi-dynamic-calculator-operations
implementation.osgi
The OSGI samples in this section have explicit configuration of the OSGI environment.
dosgi-calculator
dosgi-calculator-operations
Note | ||
---|---|---|
| ||
Understand and Document |
implementation-bpel
Note | ||
---|---|---|
| ||
contribution-helloworld-bpel
Note | ||
---|---|---|
| ||
check instructions work and fix up |
This sample demonstrates an SCA service implemented by a BPEL process.
If you just want to run it to see what happens open a command prompt, navigate
to this sample directory, and do
Code Block |
---|
ant compile run
|
OR if you don't have ant, on Windows do
Code Block |
---|
mkdir target\classes
mkdir target\wsdl2java-source |
Code Block |
mkdir target\classes mkdir target\wsdl2java-source java -cp ..\..\lib\tuscany-sca-manifest.jar org.apache.tuscany.sdo.generate.XSD2JavaGenerator -targetDirectory target/wsdl2java-source -prefix HelloWorld -noContainment -noUnsettable src/main/resources/helloworld.wsdl java -cp ..\..\lib\tuscany-sca-manifest.jar org.apache.tuscany.tools.wsdl2java.generate.WSDL2JavaGenerator -targetDirectory target/wsdl2java-source src/main/resources/helloworld.wsdl unzip ..\..\lib\ode-dao-jpa-ojpa-derby-1.1.zip -d target\database javac -d target\classes -cp target\classes;..\..\lib\tuscany-sca-manifest.jar -sourcepath src\main\java;target\wsdl2java-source -target 1.5 -g -source 1.5 src\main\java\helloworld\BPELClient.java copy src\main\resources\* target\classes java -cp ..\..\lib\tuscany-sca-manifest.jar;target\classes;target\database helloworld.BPELClient |
and on *nix do
Code Block |
---|
mkdir target/classes mkdir target/wsdl2java-source java -cp ../../lib/tuscany-sca-manifest.jar org.apache.tuscany.sdo.generate.XSD2JavaGenerator -targetDirectory target/wsdl2java-source -prefix HelloWorld -noContainment -noUnsettable src/main/resources/helloworld.wsdl java -cp ../\../\lib/\tuscany-sca-manifest.jar org.apache.tuscany.tools.wsdl2java.generate.WSDL2JavaGenerator -targetDirectory target/wsdl2java-source src/main/resources/helloworld.wsdl unzip ../\../\lib/\ode-dao-jpa-ojpa-derby-1.1.zip -d target/\database javac -d target/\classes -cp target/\classes;../\../\lib/\tuscany-sca-manifest.jar -sourcepath src/\main/\java;target/\wsdl2java-source -target 1.5 -g -source 1.5 src/\main/\java/\helloworld/\BPELClient.java cpcopy src/\main/\resources/\* target/\classes java -cp ../\../\lib/\tuscany-sca-manifest.jar:;target/\classes:;target/\database helloworld.BPELClient |
The sample will start an embedded BPEL engine, deploy a process and invoke it.
Sample Overview
The sample provides a single component that is wired to a service with a
web service binding.
and on *nix do
Code Block |
---|
mkdir target/classes
mkdir target/wsdl2java-source
java -cp ../../lib/tuscany-sca-manifest.jar org.apache.tuscany.sdo.generate.XSD2JavaGenerator -targetDirectory target/wsdl2java-source -prefix HelloWorld -noContainment -noUnsettable src/main/resources/helloworld.wsdl
java -cp ../../lib/tuscany-sca-manifest.jar org.apache.tuscany.tools.wsdl2java.generate.WSDL2JavaGenerator -targetDirectory target/wsdl2java-source src/main/resources/helloworld.wsdl
unzip ../../lib/ode-dao-jpa-ojpa-derby-1.1.zip -d target/database
javac -d target/classes -cp target/classes;../../lib/tuscany-sca-manifest.jar -sourcepath src/main/java;target/wsdl2java-source -target 1.5 -g -source 1.5 src/main/java/helloworld/BPELClient.java
cp src/main/resources/* target/classes
java -cp ../../lib/tuscany-sca-manifest.jar:target/classes:target/database helloworld.BPELClient
|
The sample will start an embedded BPEL engine, deploy a process and invoke it.
Sample Overview
The sample provides a single component that is wired to a service with a
web service binding.
Code Block |
---|
helloworld-bpel/
src/
main/
java/
|
Code Block |
helloworld-bpel/ src/ main/ java/ helloworld/ BPELClient.java - client application for helloworld/ BEPELHelloWorldComponent BPELClient.java resources/ deploy.xml - ODEclient deploymentapplication descriptorfor helloworld.bpel - helloworld bpel process helloworld.componentType - helloworld bpel service description helloworld.composite BEPELHelloWorldComponent resources/ - the SCA assembly for this sample deploy.xml - ODE deployment descriptor helloworld.wsdlbpel - helloworld bpel process helloworld.componentType - thehelloworld bpel service description that describes helloworld.composite - the SCA assembly for this sample helloworld.wsdl the bpel process - the service log4j.propertiesdescription that describes - logging configuration test/ java/ helloworld/ BPELHelloWorldTestCase.javathe bpel process - JUnit test case helloworld-bpellog4j.pngproperties - logging configuration test/ - a pictorial representation of thejava/ helloworld/ BPELHelloWorldTestCase.java - JUnit test case helloworld-bpel.png sample .composite file build.xml - a pictorial representation of the - the Ant build sample .composite file build.xml - the Ant build file pom.xml - the Maven build file |
...
Code Block |
---|
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running helloworld.BPELHelloWorldTestCase
Starting BPELHelloWorldComponent
>>> Deploying : D:\dev\Opensource\Apache\Tuscany\source\java-sca-1.1\samples\helloworld-bpel\target\classes
::arg:::::: <?xml version="1.0" encoding="UTF-8"?>
<hello xmlns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"><message xmlns="http://tuscany.apache.org/implementation/bpel/example/helloworld
.wsdl">Hello</message></hello>
::message:: <?xml version="1.0" encoding="UTF-8"?>
<message><TestPart><hello xmlns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"><message xmlns="http://tuscany.apache.org/implementation/bpel
/example/helloworld.wsdl">Hello</message></hello></TestPart></message>
Status: RESPONSE
Response: <?xml version="1.0" encoding="UTF-8"?>
<message><TestPart><hello xmlns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl">Hello World</hello></TestPart></message>
Stopping BPELHelloWorldComponent
Stopped !!!
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 18.656 sec
Results :
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO] [jar:jar]
[INFO] Building jar: D:\dev\Opensource\Apache\Tuscany\source\java-sca-1.1\samples\helloworld-bpel\target\sample-helloworld-bpel.jar
[INFO] [install:install]
[INFO] Installing D:\dev\Opensource\Apache\Tuscany\source\java-sca-1.1\samples\helloworld-bpel\target\sample-helloworld-bpel.jar to C:\Documents and Settings\lresend
e\.m2\repository\org\apache\tuscany\sca\sample-helloworld-bpel\1.1-incubating-SNAPSHOT\sample-helloworld-bpel-1.1-incubating-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 53 seconds
[INFO] Finished at: Sun Jan 13 09:54:39 PST 2008
[INFO] Final Memory: 24M/43M
[INFO] ------------------------------------------------------------------------
|
This shows that the Junit test cases have run successfully.
helloworld-recursive
Note | ||
---|---|---|
| ||
Understand and Document |
helloworld-recursive-ws
Note | ||
---|---|---|
| ||
Understand and Document |
helloworld-scaclient
Note | ||
---|---|---|
| ||
Understand and Document |
helloworld-spring
Note | ||
---|---|---|
| ||
Understand and Document |
helloworld-ws-sdo
Note | ||
---|---|---|
| ||
Understand and Document |
webapps
The contributions in the following sections may be deployed to a web container, for example Tomcat. To create the web archive for deployment to the container, run the command
mvn
in the root directory of the contributions directory structure, then deploy the resulting .war file to your web container.
Note |
---|
Should this be "See the instructions for webapps in the "running tuscany" section? |
helloworld-bpel
helloworld-jaxrs
helloworld-jms
helloworld-js-client
helloworld-jsf
helloworld-jsp
helloworld-servlet
helloworld-spring
helloworld-stripes
async
Note | ||
---|---|---|
| ||
document |
embedded-jse-async-sample-launcher
sample-contribution-implementation-java-calculator-async
binding-comet
Note | ||
---|---|---|
| ||
Understand and Document |
binding-jsonrpc
Note | ||
---|---|---|
| ||
Understand and Document |
contribution-calculator
Note | ||
---|---|---|
| ||
Understand and Document |
contribution-calculator-webapp
Note | ||
---|---|---|
| ||
Understand and Document |
binding-rmi
In this example the caluclator function is split over two contyributions in order to demonstrate the remote method invocation binding.
Note | ||
---|---|---|
| ||
Document |
contribution-calculator-reference
Note | ||
---|---|---|
| ||
Document |
contribution-calculator-service
Note | ||
---|---|---|
| ||
Document |
binding-sca
Note | ||
---|---|---|
| ||
Understand and Document |
contribution-calculator
Note | ||
---|---|---|
| ||
Understand and Document |
...
------------------------------------------------------
|
This shows that the Junit test cases have run successfully.
helloworld-bpel-webapp
implementation-composite
Note | ||
---|---|---|
| ||
Understand and Document |
contribution-calculator
distributed-osgi
These samples demonstrate the execution of Tuscany contributions in a distributed OSGI environment.
dynamic
The OSGI samples in this section dynamically configure of the OSGI environment.
dosgi-dynamic-calculator
dosgi-dynamic-calculator-operations
implementation.osgi
The OSGI samples in this section have explicit configuration of the OSGI environment.
dosgi-calculator
...
helloworld-recursive
Note | ||
---|---|---|
| ||
Understand and Document |
helloworld-recursive-ws
Note | ||
---|---|---|
| ||
Understand and Document |
...
Note | ||
---|---|---|
| ||
Understand and Document |
implementation-script
Note | ||
---|---|---|
| ||
Understand and Document |
contribution-calculator
Note | ||
---|---|---|
| ||
Understand and Document |
implementation-spring
Note | ||
---|---|---|
| ||
Understand and Document |
contribution-helloworld-
...
spring
Note | ||
---|---|---|
| ||
Understand and Document |
helloworld-spring-webapp
implementation-webapp
helloworld-jaxrs-webapp
helloworld-jms-webapp
helloworld-js-client-webapp
helloworld-jsf-webapp
helloworld-jsp-webapp
helloworld-servlet-webapp
helloworld-stripes-webapp
logging-scribe
Note | ||
---|---|---|
| ||
Understand and Document |
...
Note | ||
---|---|---|
| ||
Understand and Document |
calculator-scaclient
Note | ||
---|---|---|
| ||
Understand and Document |
helloworld-scaclient
Note | ||
---|---|---|
| ||
Understand and Document |
...