Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This is the simplest contribution. This contribution describes a composite application with a single component implemented in Java. The component's Java implementation provides service "business logic" for saying hello to a person whose name is supplied as input to the service.

Panel
bgColorpink

To build this contribution using Maven do the following:

TODO

Panel
bgColorsilver

To build this contribution using Maven do the following:

Code Block

cd helloworld-contribution
mvn

This will produce the contribution as follows:

Code Block

helloworld-contribution/target/helloworld-contribution.jar

You can run the contribution using Maven by doing the following:

Code Block

cd helloworld-contribution
mvn tuscany:run
Note
titleTODO

And then what? (warning)

...

This sample is not a contribution in it's own right but demonstrates how to run the helloworld-contribution inside a web application.

Panel
bgColorsilver

To build this contribution using Maven do the following:

Code Block

cd helloworld-webapp
mvn

This will produce a webapp as follows:

Code Block

helloworld-webapp/target/helloworld.war

You can run this webapp by deploying it to you're favourite webapp container. For example, you can deploy to Tomcat and run as follows:

...

This directory contains sample java launchers for the some of the Tuscany sample contributions from the learning-more directory. It shows you how to embed the Tuscany runtime in a Java program. To make you're own launchers simply copy and existing one and change the details of the contribution being loaded. You'll note that the same launcher code is used inside the contribution unit test demonstrated by maven-junit.

To use the sample JSE launchers from maven do the following:

Code Block

cd embedded-jse
mvn

...

Panel
bgColorpink

To use the sample JSE launchers with ant execute the command

Code Block

ant <contributionname>

where <contributionname> is one of the targets in the provided build.xml file

Panel
bgColorsilver

embedded-osgi

To use the sample JSE launchers from Maven do the following:

Code Block

cd embedded-jse
mvn

This runs a JUnit test case that runs all the launchers in turn.

embedded-osgi

The Tuscany runtime jars will The Tuscany runtime jars will also work within an OSGi enviroment. If you want to load them into a vanilla OSGi environment see the osgi directory. If you want Tuscany to create an OSGi environment for you this directory contains launchers that do just that.

Panel
bgColorpink

To use the sample

...

OSGI launchers

...

with ant do the following:

Code Block

cd embedded-osgi
mvn

...

ant <contributionname>

where <contributionname> is one of the targets in the build.xml file

Panel
bgColorsilver

To use the sample

...

JSE launchers

...

from Maven do the following:

Code Block

cd embedded-osgi
ant <contributionname>

...

mvn

This runs a JUnit test case that runs all the launchers in turn.

maven

Maven can be used to install contributions. Tuscany has a special plugin (maven-tuscany-plugin) that makes this happen. Look for contributions that have the following configuration in their pom.xml file:

...

contribution-calculator-webapp

This contribution pacakges the same calculator-contribution inside a webapp.

Panel
bgColorsilver

The webapp can be built using Maven as follows:

Code Block

cd learning-more/binding-jsonrpc/calcualtor-webapp
mvn

The webapp can be installed and run as follows:

Code Block

cd learning-more/binding-jsonrpc/calcualtor-webapp
cp target/sample-binding-jsonrpc-calculator-webapp.war <your_container_deployment-dir>
start the container as appropriate

Once the webapp is deployed point your browser at:

Code Block

http://localhost:8080/sample-binding-jsonrpc-calculator-webapp/
Note
titleTODO
Understand and Document

binding-rmi

In this example the calculator function is split over two contributions in order to demonstrate the remote method invocation binding. The CalculatorService in the CalculatorServiceComponent defined in the CalculatorRMIServer.composite file is configured to be accessible using RMI.

...