Tuscany 2.0-Beta1 Samples
The Tuscany Samples samples are shipped with Tuscany binary and source releases (see the /samples directory). 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.
The contents of the Samples page contains the very latest documentation for the samples in trunklinks to the various different versions of samples documentation.
In a distribution, the samples source code is found 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.
If you're new to Tuscany SCA start with the getting-started. Samples are generally presented in the form on an SCA contribution (look for directories ending in "-contribution") or as a webapp (look for directories ending in "-webapp"). The directories getting-started, learning-more and applications all contain sample SCA contributions of increasing complexity. The running-tuscany directory describes the various different ways you can start the Tuscany runtime and install contributions. For each sample contribution described in this document we do suggest an example way to install it and start the composites it contains however the other approaches in running-tuscany should also work for most sample contributions. The extending-tuscany directory contains some examples of how to build new binding and implementation extensions for using in Tuscany.
In the following text we us use <some_text> to mean you have to replace it with whatever is appropriate in your environment. For example <tuscany_bin_distro> means the directory in which you install the Tuscany binary distribution.
...
callback-api
Note |
---|
|
This feels like a learning-more sample. I wouldn't focus on callbacks with the first time user |
sca-scopes
Note |
---|
|
This feels like a learning-more sample. I wouldn't focus on scopes with the first time user |
sca-include-contribution
Note |
---|
|
This feels like a learning-more sample. I wouldn't focus on inclusion with the first time user |
running-tuscany
Running something in Tuscany requires one or more contributions, and a method of launching the contributions to make the services they provide available. The sections below describes various means of launching contributions with the Tuscany SCA Java runtime. It's not important that you try all of these but they show you what's possible and hopefully show you how to use Tuscany in an environment that makes sense to you.
Some of the running-tuscany sub-directories just contain a README that gives you instructions. For example, maven just tells you how to configure and run contributions using the maven-tuscany-plugin. Others contain code. For example, embedded-jse contains simple Java launchers that show you how to start some of the sample contributions from a Java program.
The sample contributions in getting-started and learning-more should work regardless of which approach you adopt. However some approaches, like embedded-jse, don't have launchers for every single sample contribution.
command-line
You can execute a sample contribution from the command line on Windows or Linux.
Note |
---|
|
Waiting for tuscany.bat to be reworked before correcting |
To execute a sample contribution from the command line
on Windows, from a command prompt in the samples directory, run the command ...
Code Block |
---|
<tuscany_din_distro>\bin\tuscany.bat "contribution-name"
|
for example
Code Block |
---|
cd <tuscany_din_distro>\samples\learning-more\binding-sca\calculator-contribution
<tuscany_din_distro>\bin\tuscany.bat sample-binding-sca-calculator-contribution.jar
|
or on *nix platforms, from a shell prompt in the samples directory, run the command ...
Code Block |
---|
cd <tuscany_din_distro>/samples/learning-more/binding-sca/calculator-contribution
<tuscany_din_distro>/bin/tuscany.sh sample-binding-sca-calculator-contribution.jar
|
eclipse
To import sample contributions into Eclipse you first need to import the Tuscany runtime. You then need to import the sample contribution into Eclipse as a project. Instructions for doing both of these things can be found here
http://tuscany.apache.org/import-existing-tuscany-sca-projects-into-eclipse.html
Note. these instructions refer to our 1.x code base but it holds true for our 2.x code base.
Once you have a contribution imported into Eclipse and cleanly compiling against the Tuscany runtime jars you probably want to be able to run and debug it. The easiest way to do this is with a simple Java launcher. If you import the running-tuscany/embedded-jse project into Eclipse you'll see a number of such launcher programs which you can copy to launch the contribution(s) of your choice. Alternatively you can add a JUnit test case to the contribution that starts Tuscany and launches the contribution. See maven-junit as an example of how to do this.
embedded-jse
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.
Panel |
---|
|
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 |
---|
|
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 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 |
---|
|
To use the sample OSGI launchers with ant do the following: Code Block |
---|
cd embedded-osgi
ant <contributionname>
|
where <contributionname> is one of the targets in the build.xml file |
Panel |
---|
|
To use the sample JSE launchers from Maven do the following: Code Block |
---|
cd embedded-osgi
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:
Code Block |
---|
<plugin>
<groupId>org.apache.tuscany.maven.plugins</groupId>
<artifactId>maven-tuscany-plugin</artifactId>
<version>2.0-SNAPSHOT</version>
</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
mvn tuscany:run
This will install the contribution in the Tuscany runtime, start the composite it contains, 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/sca-client/calculator-scaclient.
maven-junit
Maven will run JUnit tests found in a module's src/test/java directory automatically. If you use embedded-jse style code in the JUnit test to install a contribution and start any composites it contains they you can unit test your contributions. This directory contains a contribution and a unit test which installs the contribution using very similar code to that found in embedded-jse.
To run the contributions unit test do the following:
Code Block |
---|
cd maven-junit/calculator-contribution
mvn
|
maven-junit-osgi
You can use a special Tuscany Maven plugin (maven-osgi-junit-plugin) to unit test contributions in a JUnit environment. This relies on adding some configuration to the Maven pom.xml. For example, if you look in maven-junit-osgi/calculator-osgi you'll see:
Code Block |
---|
<plugin>
<groupId>org.apache.tuscany.maven.plugins</groupId>
<artifactId>maven-osgi-junit-plugin</artifactId>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-node-launcher-equinox</artifactId>
<version>${pom.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>osgi-test</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<systemProperties>
<property>
<name>osgi.configuration.area</name>
<value>${project.build.directory}/equinox</value>
</property>
</systemProperties>
</configuration>
</execution>
</executions>
</plugin>
|
This configures the maven-osgi-junit-plugin to use the tuscany-node-launcher-equinox to install the contribution represented by the calculator-osgi directory. As an alternative to this configuration you could use the contents of tuscany-node-launcher-equinox directly in your JUnit test to launch the Tuscany runtime using OSGi.
To run the contributions unit test do the following:
Code Block |
---|
cd maven-junit/calculator-contribution
mvn
|
osgi
The Tuscany runtime can be run in a vanilla OSGi container such as Equinox. To do this you have to:
- launch the OSGi container itself
- load the Tuscany runtime bundles (all our jars are bundles) into the container
- install a contribution packaged as an OSGi bundle
For example, to install a contribution in Equinox do the following
On Windows, run
Code Block |
---|
java -jar ..\..\..\modules\osgi-3.5.0-v20090520.jar -configuration ..\..\..\features\configuration -clean -console
|
On *Unix, run
Code Block |
---|
java -jar ../../../modules/osgi-3.5.0-v20090520.jar -configuration ../../../features/configuration -clean -console
|
You should see the osgi console:
Code Block |
---|
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.
Then you can install and start contributions as bundles by doing the following:
Code Block |
---|
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
Running on Felix
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.
Note |
---|
|
We currently have two similar approaches available (see command-line). We need to merge the two together. |
To build the sample shell do this:
To run it:
at the prompt:
Code Block |
---|
start myNode ../../applications/store/target/sample-store.jar
|
or:
Code Block |
---|
start myNode http://people.apache.org/~jsdelfino/tuscany/java/test/sample-store.jar
|
also try:
Code Block |
---|
status
stop myNode
bye
|
Starting and stopping composites is pretty fast. To see that, try the following
two scripts, which start/stop the sample store composite 10 times.
Code Block |
---|
./sca <scripts/test.txt
|
or
Code Block |
---|
./sca <scripts/test-remote.txt
|
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
Tuscany can be embedded inside a webapp alongside one or more SCA contributions. 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
For example, for binding-jsonrpc/contribution-calculator-webapp, do the following:
Code Block |
---|
cd samples/binding-jsonrpc/contribution-calculator-webapp
mvn
cp target/sample-contribution-binding-jsonrpc-calculator-webapp.war <your_container_deployment-dir>
|
As an alternative, sample webapp based contributions can be run within Jetty directly from Maven, look for webapp contributions that have the following configuration in their pom.xml file:
Code Block |
---|
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.18</version>
</plugin>
|
For contributions that have this, for example, binding-jsonrpc/contribution-calculator-webapp, do the following
Code Block |
---|
cd samples/binding-sca/contribution-calculator
mvn jetty:run
|
This will launch the contribution in the Jetty runtime and then wait. At this point you can use HTTP clients to send messages to services that the running SCA applcation exposes. For this example try pointing your browser at:
Code Block |
---|
http://localhost:8080/sample-binding-jsonrpc-calculator-webapp/
|
learning-more
The samples found in the contributions below illustrate more of SCA and Tuscany's features in action. The contributions here are primarily focused on demonstrating the various SCA extensions that the Tuscany runtime supports, for example, bindings and implementations. The directories are named to let you easily find a sample of the extension you're interested in.
You can identify contributions here as the name of the directory from which they are built ends with "-contribution". There are also webapp samples here. The names of these directories end with "-webapp".
Refer to the information above in the "running-tuscany" section to find the various options for installing these sample contributions. We present an single default approach for each sample as an example.
async
This sample demonstrates the SCA asynchronous progamming model in action as typified by services that are configured with the asyncInvocation intent. For example, from calculator-contribution
Code Block |
---|
@Remotable
@AsyncInvocation
public interface CalculatorServiceAsync {
void calculateAsync(Integer n1, ResponseDispatch<String> response);
}
|
A client component can access an asynchronous service either synchronously or asynchronously. Asynchronous reference interfaces also have a special form, again from calculator-contribution:
Code Block |
---|
@Remotable
public interface CalculateReferenceAsync {
// Sync
public String calculate(Integer i1);
// Aysnc Poll
public Response<String> calculateAsync(Integer i1);
// Async Callback
public Future<String> calculateAsync(Integer i1, AsyncHandler<String> handler);
}
|
calculator-contribution
This contribution defines synchronous and asynchronous component services and a client component which references both. During the test the client component exercise all three styles of reference interface operation against both the synchronous and asynchronous service.
learning-more
Note |
---|
|
All of the run instructions here are subject to change. I just picked ones that works but ideally we'd use the command line consistently when that is operating correctly. Also Mike commented that it's unnatural and confusing to "cd running-tuscany/xyz" to run a sample. This should also be solved if we can go with the command line. |
The samples found in the contributions below illustrate more of SCA and Tuscany's features in action. The contributions here are primarily focused on demonstrating the various SCA extensions that the Tuscany runtime supports, for example, bindings and implementations. The directories are named to let you easily find a sample of the extension you're interested in.
You can identify contributions here as the name of the directory from which they are built ends with "-contribution". There are also webapp samples here. The names of these directories end with "-webapp".
async
This sample demonstrates the SCA asynchronous progamming model in action as typified by services that are configured with the asyncInvocation intent. For example, from calculator-contribution
Code Block |
---|
@Remotable
@AsyncInvocation
public interface CalculatorServiceAsync {
void calculateAsync(Integer n1, ResponseDispatch<String> response);
}
|
A client component can access an asynchronous service either synchronously or asynchronously. Asynchronous reference interfaces also have a special form, again from calculator-contribution:
Code Block |
---|
@Remotable
public interface CalculateReferenceAsync {
// Sync
public String calculate(Integer i1);
// Aysnc Poll
public Response<String> calculateAsync(Integer i1);
// Async Callback
public Future<String> calculateAsync(Integer i1, AsyncHandler<String> handler);
}
|
calculator-contribution
This contribution defines synchronous and asynchronous component services and a client component which references both. During the test the client component exercise all three styles of reference interface operation against both the synchronous and asynchronous service.
Panel |
---|
|
The contribution can be built using Ant as follows: Code Block |
---|
cd learning-more/async/calculator-contribution
ant
|
The contribution can be installed and the composite it contains run using Ant as follows Code Block |
---|
cd running-tuscany/embedded-jse
ant sample-implementation-java-calculator-async-contribution
|
|
Panel |
---|
|
The contribution can be built using Maven as follows: Code Block |
---|
cd learning-more/async/calculator-contribution
mvn
|
The contribution can be installed and the composite it contains run using Maven as follows Code Block |
---|
cd running-tuscany/embedded-jse
mvn
|
This will run several contributions including the sample-implementation-java-calculator-async-contribution. |
binding-comet
The Comet protocol allows a servlet to process IO asynchronously, receiving events when data is available for reading on the connection (rather than always using a blocking read), and writing data back on connections asynchronously (most likely responding to some event raised from some other source).
weather-webapp
Executing the command "mvn" in this sample project creates a web archive suitable for deployment to Tomcat. It makes use of the tuscany comet binding.
Panel |
---|
|
The webapp can be built using Maven as follows: Code Block |
---|
cd learning-more/binding-commet/weather-webapp
mvn
|
|
The webapp can be installed and run as follows:
Code Block |
---|
cd learning-more/binding-commet/weather-webapp
cp target/sample-binding-comet-1.0.war <your_container_deployment-dir>
start the container as appropriate
|
binding-jms
This binding supports message orient communication via the JMS API.
helloworld-webapp
This contribution packages an SCA application inside a webapp. The application has two components which exchange helloworld style messages over the JMS binding.
Panel |
---|
|
The webapp can be built using Maven as follows: Code Block |
---|
cd learning-more/binding-jms/helloworld-webapp
mvn
|
|
The webapp can be installed and run as follows:
Code Block |
---|
cd learning-more/binding-jms/helloworld-webapp
cp target/helloworld-jms.war <your_container_deployment-dir>
start the container as appropriate
|
Warning |
---|
|
By rights the webapp should be called sample-binding-jms-helloworld-webapp.war |
Once the webapp is deployed point your browser at:
Code Block |
---|
http://localhost:8080/helloworld-jms/
|
binding-jsonrpc
This binding supports communication over the JSON-RPC protocol.
calculator-contribution
This sample demonstrates using the simple calculator service component which makes use of four other services for add, subtract, multiply and divide functions. In this variant of the calculator sample the AddService is configured to be invoked using the JSON-RPC protocol. You can see the configuration by looking in the src/main/resources/Calculator.composite xml file.
Panel |
---|
|
The contribution Jar can be built using Ant as follows: Code Block |
---|
cd learning-more/binding-jsonrpc/calculator-contribution
ant
|
The contribution can be installed and the composite it contains run using Ant as follows: Code Block |
---|
cd running-tuscany/embedded-jse
ant sample-implementation-java-calculator-async-contribution
|
|
Panel |
---|
|
The contribution Jar can be built using Maven as follows: Code Block |
---|
cd learning-more/binding-jsonrpc/calculator-contribution
mvn
|
The contribution can be installed and the composite it contains run using Maven as follows Code Block |
---|
cd running-tuscany/embedded-jse
mvn
|
This will run several contributions including the sample-implementation-java-calculator-async-contribution. |
calculator-webapp
This contribution packages the same calculator-contribution inside a webapp.
Panel |
---|
|
The webapp can be built using Maven as follows: Code Block |
---|
cd learning-more/binding-jsonrpc/calculator-webapp
mvn
|
|
The webapp can be installed and run as follows:
Code Block |
---|
cd learning-more/binding-jsonrpc/calculator-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/
|
binding-rmi
In this example the calculator function is split over two contributions in order to demonstrate the remote method invocation binding (binding.rmi). The calculator-service-contribution contains a composite which defines a CalculatorServiceComponent which exposes a CalculatorService using binding.rmi. The calculator-reference-contribution contains a composite which also defines a CalculatorServiceComponent but which in this case calls the add, subtract, multiple and divide operations offered by the component in the calculator-service-contribution. The two contributions are run using separate Tuscany nodes and the resulting components communicate over RMI. Both contributions must be deployed and started for the sample to work;
Panel |
---|
|
The contributions can be installed and the composite they contain run using Ant as follows: Code Block |
---|
cd running-tuscany/embedded-jse
ant sample-binding-rmi-calculator-contribution
|
|
Panel |
---|
|
The contributions can be installed and the composite they contain run using Ant as follows: Code Block |
---|
cd running-tuscany/embedded-jse
mvn
|
This will run several contributions including the binding-rmi sample contributions |
calculator-service-contribution
This contribution defines a CalculatorServiceComponent whose add, subtract, multiply and divide operations are available over RMI.
Panel |
---|
|
The contribution Jar can be built using Ant as follows: Code Block |
---|
cd learning-more/binding-rmi/calculator-service-contribution
ant
|
|
Panel |
---|
|
The contribution Jar can be built using Maven as follows: Code Block |
---|
cd learning-more/binding-rmi/calculator-service-contribution
mvn
|
|
calculator-reference-contribution
This sample extends the calculator sample by replacing the local wired connections with RMI bindings. Instead of local add, subtract, multiply and divide components, an RMI service implementation now provides the add, subtract, multiply and divide interfaces and is hosted as an RMI server. References specified in the .composite file include an RMI binding which targets
this RMI server.
Panel |
---|
|
The contribution Jar can be built using Ant as follows: Code Block |
---|
cd learning-more/binding-rmi/calculator-reference-contribution
ant
|
|
Panel |
---|
|
The contribution Jar can be built using Maven as follows: Code Block |
---|
cd learning-more/binding-rmi/calculator-reference-contribution
mvn
|
|
binding-sca
This sample is the simplest sample other than that shown in the getting starting section. It uses the default SCA protocol for communicating between the various components of the caluclator application.
calculator-contribution
The service and reference definitions in the Calculator.composite and CalculatorClient.composite files have no binding attributes, thereby defaulting to the SCA binding for communication between the running instances of the components.
Panel |
---|
|
The contribution Jar can be built using Ant as follows: Code Block |
---|
cd learning-more/binding-sca/calculator-contribution
ant
|
The contribution can be installed and the composite it contains run using Ant as follows: Code Block |
---|
cd running-tuscany/embedded-jse
ant sample-binding-sca-calculator-contribution
|
|
Panel |
---|
|
The contribution Jar can be built using Maven as follows: Code Block |
---|
cd learning-more/binding-sca/calculator-contribution
mvn
|
The contribution can be installed and the composite it contains run using Maven as follows Code Block |
---|
cd running-tuscany/embedded-jse
mvn
|
This will run several contributions including the sample-binding-sca-calculator-contribution. |
binding-ws
The web service binding allows components to expose and call services using SOAP formatted messages primarily over HTTP.
calculator-contribution
This contribution provides the four arithmetic operations in the calculator service, with the AddService being accessible as a web service via the URL http://localhost:8085/AddServiceComponent, as configured in the Calculator.composite file.
Panel |
---|
|
The contribution Jar can be built using Ant as follows: Code Block |
---|
cd learning-more/binding-ws/calculator-contribution
ant
|
The contribution can be installed and the composite it contains run using Ant as follows: Code Block |
---|
cd running-tuscany/embedded-jse
ant sample-binding-ws-calculator-contribution
|
|
Panel |
---|
|
The contribution Jar can be built using Maven as follows: Code Block |
---|
cd learning-more/binding-ws/calculator-contribution
mvn
|
The contribution can be installed and the composite it contains run using Maven as follows Code Block |
---|
cd running-tuscany/embedded-jse
mvn
|
This will run several contributions including the sample-binding-sca-calculator-contribution. |
contribution-helloworld-ws-sdo
This sample demonstrates an SCA reference that uses a web service binding which works with SDO. Instead if using JAXB style Java beans in the service interface they are replaced with SDO object.
Note |
---|
|
Sample not currently enabled - awaiting SDO support |
distributed-osgi
These samples demonstrate the execution of Tuscany contributions in a OSGI environment. In particular the two bundle project in this directory define calculator objects that communicate with one another using the mechanisms defined in the OSGi remote services specifications. Here the Tuscany SCA runtime provides dynamic service discovery functionality. The calculator objects are registered as services directly with the OSGi bundle context by the bundle activator. Under the covers SCA provides the remote service disovery features that allow OSGi registered service to discover and communicate with one another across two JVMs.
To run the sample each bundle must be build using maven and then loaded into a separate OSGi environment into which the Tuscany SCA runtime has already been installed (See "osgi" under running-tuscany)
dosgi-dynamic-calculator-operations
This bundle provides the calculator add, subtract, multiple, divide operations services.
Panel |
---|
|
The bundle Jar can be built using Maven as follows: Code Block |
---|
cd learning-more/distributed-osgi/dosgi-dynamic-calculator-operations
mvn
|
|
Note |
---|
|
projects should be called dosgi-dynamic-calculator-operations-bundle |
To run the bundle see "osgi" under running-tuscany. In short do the following:
On Windows, run
Code Block |
---|
java -jar ..\..\..\..\modules\osgi-3.5.0-v20090520.jar -configuration ..\..\..\..\features\configuration -clean -console
|
You should see the osgi console. You can run "ss" command under the osgi> to see the status of the bundles.
Then you can install and start the bundle that's just been built:
Code Block |
---|
osgi> install file:./target/sample-dosgi-dynamic-calculator-operations.jar
|
dosgi-dynamic-calculator
Panel |
---|
|
The bundle Jar can be built using Maven as follows: Code Block |
---|
cd learning-more/distributed-osgi/dosgi-dynamic-calculator
mvn
|
|
Note |
---|
|
projects should be called dosgi-dynamic-calculator-bundle |
To run the bundle see "osgi" under running-tuscany. In short do the following:
On Windows, run
Code Block |
---|
java -jar ..\..\..\..\modules\osgi-3.5.0-v20090520.jar -configuration ..\..\..\..\features\configuration -clean -console
|
You should see the osgi console. You can run "ss" command under the osgi> to see the status of the bundles.
Then you can install and start the bundle that's just been built:
Code Block |
---|
osgi> install file:./target/sample-dosgi-dynamic-calculator.jar
|
You should see the calculator service start.
implementation-bpel
BPEL component implementations will be useful to those who wish to describe a sequence of calls that must be made to other component services.
contribution-helloworld-bpel
Panel |
---|
|
The contribution Jar can be built using Ant as follows: Code Block |
---|
cd learning-more/implementation-bpel/helloworld-bpel-contribution
ant
|
The contribution can be installed and the composite it contains run using Ant as follows: |
Panel |
---|
|
The contribution Jar can be built using Maven as follows: Code Block |
---|
cd learning-more/implementation-bpel/helloworld-bpel-contribution
mvn
|
The contribution can be installed and the composite it contains run using Maven as follows |
helloworld-bpel-webapp
implementation-composite
Note |
---|
|
Understand and Document |
helloworld-recursive
Note |
---|
|
Understand and Document |
helloworld-recursive-ws
Note |
---|
|
Understand and Document |
implementation-java
The sample provides a single calculator service with a default SCA binding. The CalculatorClient exercises this interface by calling add, subtract, multiply and divide operations. This results in messages passing to the appropriate components in the composite across the local wires.
contribution-calculator
Panel |
---|
|
The contribution Jar |
Panel |
---|
|
The contribution can be built using Ant as follows: Code Block |
---|
cd learning-more/asyncimplementation-java/calculator-contribution
ant
|
The contribution can be installed and the composite it contains run using Ant as follows: Code Block |
---|
cd running-tuscany/embedded-jse
ant sample-implementation-java-calculator-async-contribution
|
|
Panel |
---|
|
The contribution Jar can be built using Maven as follows: Code Block |
---|
cd learning-more/asyncimplementation-java/calculator-contribution
mvn
|
The contribution can be installed and the composite it contains run using Maven as follows Code Block |
---|
cd running-tuscany/embedded-jse
mvn
|
This will run several contributions including the sample-implementation-java-calculator-async-contribution. |
implementation.osgi
binding-comet
The Comet protocol allows a servlet to process IO asynchronously, receiving events when data is available for reading on the connection (rather than always using a blocking read), and writing data back on connections asynchronously (most likely responding to some event raised from some other source).
weather-webapp
Executing the command "mvn" in this sample project creates a web archive suitable for deployment to Tomcat. It makes use of the tuscany comet binding.
Panel |
---|
|
The webapp can be built using Maven as follows: Code Block |
---|
cd learning-more/binding-commet/weather-webapp
mvn
|
|
The webapp can be installed and run as follows:
Code Block |
---|
cd learning-more/binding-commet/weather-webapp
cp target/sample-binding-comet-1.0.war <your_container_deployment-dir>
start the container as appropriate
|
binding-jms
This binding supports message orient communication via the JMS API.
helloworld-webapp
This contribution packages an SCA application inside a webapp. The application has two components which exchange helloworld style messages over the JMS binding.
Panel |
---|
|
The webapp can be built using Maven as follows: Code Block |
---|
cd learning-more/binding-jms/helloworld-webapp
mvn
|
|
...
dosgi-calculator
Panel |
---|
|
The bundle Jar can be built using Maven as follows: Code Block |
---|
cd learning-more/implementation-osgi/dosgi-calculator
mvn
|
|
Note |
---|
|
projects should be called dosgi-calculator-bundle |
To run the bundle see "osgi" under running-tuscany. In short do the following:
On Windows, run
Code Block |
---|
java -jar ..\..\..\..\modules\osgi-3.5.0-v20090520.jar -configuration ..\..\..\..\features\configuration -clean -console
|
You should see the osgi console. You can run "ss" command under the osgi> to see the status of the bundles.
Then you can install and start the bundle that's just been built:
Code Block |
---|
osgi> install file:./target/sample-dosgi-calculator.jar
|
You should see the calculator service start.
dosgi-calculator-operations
This bundle provides the calculator add, subtract, multiple, divide operations services.
Panel |
---|
|
The bundle Jar can be built using Maven as follows: Code Block |
---|
cd learning-more/ | bindingjmshelloworldwebapp
cp target/helloworld-jms.war <your_container_deployment-dir>
start the container as appropriate
|
Warning |
---|
|
By rights the webapp should be called sample-binding-jms-helloworld-webapp.war |
Once the webapp is deployed point your browser at:
Code Block |
---|
http://localhost:8080/helloworld-jms/
|
binding-jsonrpc
This binding supports communication over the JSON-RPC protocol.
calculator-contribution
This sample demonstrates using the simple calculator service component which makes use of four other services for add, subtract, multiply and divide functions. In this variant of the calculator sample the AddService is configured to be invoked using the JSON-RPC protocol. You can see the configuration by looking in the src/main/resources/Calculator.composite xml file.
...
The contribution Jar can be built using Ant as follows:
Code Block |
---|
cd learning-more/binding-jsonrpc/calculator-contribution
ant
|
The contribution can be installed and the composite it contains run using Ant as follows:
Note |
---|
|
projects should be called dosgi-calculator-operations-bundle |
To run the bundle see "osgi" under running-tuscany. In short do the following:
On Windows, run
Code Block |
---|
java -jar ..\..\..\..\modules\osgi-3.5.0-v20090520.jar -configuration ..\..\..\..\features\configuration -clean -console
|
You should see the osgi console. You can run "ss" command under the osgi> to see the status of the bundles.
Then you can install and start the bundle that's just been built:
Code Block |
---|
osgi> install file:./target/sample-dosgi-calculator-operations.jar
|
implementation-script
This sample provides a simple calculator service whose operations are implemented using four different script languages.
contribution-calculator
...
Panel |
---|
|
The contribution bundle Jar can be built using Maven as follows: Code Block |
---|
cd learning-more/bindingimplementation-jsonrpcscript/calculator-contribution
mvn
|
|
Panel |
---|
|
The contribution Jar can be installed and the composite it contains run using Maven built using Ant as follows: Code Block |
---|
cd running-tuscany/embedded-jse
mvn
|
This will run several contributions including the sample-implementation-java-calculator-async-contribution. |
calculator-webapp
...
learning-more/implementation-script/calculator-contribution
ant
|
The contribution can be installed and the composite it contains run using Ant as follows: |
implementation-spring
The Spring implementation sample contains a simple Hello World service and client using implementation.spring.
contribution-helloworld-spring
Panel |
---|
|
The webapp bundle Jar can be built using Maven as follows: Code Block |
---|
cd learning-more/bindingimplementation-jsonrpcspring/calculatorhelloworld-spring-webappcontribution
mvn
|
|
The webapp can be installed and run as follows:
helloworld-spring-webapp
The HelloWorld Spring WebApp sample contains a simple Hello World service implemented using Spring and wrapped in a webApp.
Panel |
---|
|
The bundle Jar can be built using Maven as follows: |
Code Block |
---|
cd bindingjsonrpccalculator
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/
|
binding-rmi
In this example the calculator function is split over two contributions in order to demonstrate the remote method invocation binding (binding.rmi). The calculator-service-contribution contains a composite which defines a CalculatorServiceComponent which exposes a CalculatorService using binding.rmi. The calculator-reference-contribution contains a composite which also defines a CalculatorServiceComponent but which in this case calls the add, subtract, multiple and divide operations offered by the component in the calculator-service-contribution. The two contributions are run using separate Tuscany nodes and the resulting components communicate over RMI. Both contributions must be deployed and started for the sample to work;
Panel |
---|
|
The contributions can be installed and the composite they contain run using Ant as follows: Code Block |
---|
cd running-tuscany/embedded-jse
ant sample-binding-rmi-calculator-contribution
|
|
Panel |
---|
|
The contributions can be installed and the composite they contain run using Ant as follows: Code Block |
---|
cd running-tuscany/embedded-jse
mvn
|
This will run several contributions including the binding-rmi sample contributions |
calculator-service-contribution
This contribution defines a CalculatorServiceComponent whose add, subtract, multiply and divide operations are available over RMI.
Panel |
---|
|
The contribution Jar can be built using Ant as follows: Code Block |
---|
cd learning-more/binding-rmi/calculator-service-contribution
ant
|
|
Panel |
---|
|
The contribution Jar can be built using Maven as follows: Code Block |
---|
cd learning-more/binding-rmi/calculator-service-contribution
mvn
|
|
calculator-reference-contribution
This sample extends the calculator sample by replacing the local wired connections with RMI bindings. Instead of local add, subtract, multiply and divide components, an RMI service implementation now provides the add, subtract, multiply and divide interfaces and is hosted as an RMI server. References specified in the .composite file include an RMI binding which targets
this RMI server.
Panel |
---|
|
The contribution Jar can be built using Ant as follows: Code Block |
---|
cd learning-more/binding-rmi/calculator-reference-contribution
ant
|
|
Panel |
---|
|
The contribution Jar can be built using Maven as follows: Code Block |
---|
cd learning-more/binding-rmi/calculator-reference-contribution
mvn
|
|
binding-sca
This sample is the simplest sample other than that shown in the getting starting section. It uses the default SCA protocol for communicating between the various components of the caluclator application.
calculator-contribution
The service and reference definitions in the Calculator.composite and CalculatorClient.composite files have no binding attributes, thereby defaulting to the SCA binding for communication between the running instances of the components.
Panel |
---|
|
The contribution Jar can be built using Ant as follows: Code Block |
---|
cd learning-more/binding-sca/calculator-contribution
ant
|
The contribution can be installed and the composite it contains run using Ant as follows: Code Block |
---|
cd running-tuscany/embedded-jse
ant sample-binding-sca-calculator-contribution
|
|
Panel |
---|
|
The contribution Jar can be built using Maven as follows: Code Block |
---|
cd learning-more/binding-sca/calculator-contribution
mvn
|
The contribution can be installed and the composite it contains run using Maven as follows Code Block |
---|
cd running-tuscany/embedded-jse
mvn
|
This will run several contributions including the sample-binding-sca-calculator-contribution. |
binding-ws
The web service binding allows components to expose and call services using SOAP formatted messages primarily over HTTP.
calculator-contribution
This contribution provides the four arithmetic operations in the calculator service, with the AddService being accessible as a web service via the URL http://localhost:8085/AddServiceComponent
Image Removed, as configured in the Calculator.composite file.
Panel |
---|
|
The contribution Jar can be built using Ant as follows: Code Block |
---|
cd learning-more/binding-ws/calculator-contribution
ant
|
The contribution can be installed and the composite it contains run using Ant as follows: Code Block |
---|
cd running-tuscany/embedded-jse
ant sample-binding-ws-calculator-contribution
|
|
implementation-web
The Web implementation samples contain examples of a HelloWorld service implemented using implementation.web and accessed with various different technologies.
helloworld-jaxrs-webapp
The HelloWorld JAX-RS WebApp sample uses implementation.web with JAX-RS to display a simple "Hello World" message from a webapp.
helloworld-js-client-webapp
The HelloWorld JavaScript client Webapp sample uses implementation.web and a javascript client to call a simple "Hello World" service and display the results.
helloworld-jsf-webapp
The HelloWorld JSF WebApp sample shows a simple "Hello World" service implemented in a webapp and accessed using Java Server Faces.
helloworld-jsp-webapp
The HelloWorld JSP WebApp sample uses implementation.web and a JSP client to invoke a simple "Hello World" service and display the results.
helloworld-servlet-webapp
The HelloWorld Servlet WebApp sample uses implementation.web with a servlet to return a simple "Hello World" message in response to a request.
helloworld-stripes-webapp
The HelloWorld Stripes WebApp sample uses implementation.web with Stripes to display a simple "Hello World" message from a webapp.
logging-scribe
This Tuscany sample shows how to implement and use a simple Logger component that logs string messages to a Scribe logging server.
Scribe is an open source server for aggregating streaming log data. It is designed to scale to a very large number of nodes and be robust to network and node failures.
See the Scribe Wiki 1 for more information on Scribe.
Getting the requires Apache Thrift library
This sample uses Apache Thrift's libthrift.jar to communicate with Scribe servers. Libthrift is not yet available in a Maven repository, so before building the sample with maven you need to download libthrift 2 and install it in your local maven repository like this:
Code Block |
---|
mvn install:install-file -DgroupId=org.apache.thrift -DartifactId=libthrift -Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dfile=libthrift-r917130.jar
|
Starting a Scribe server
Before running the LoggingTest sample test program, you need to start a Scribe server for the sample program to connect to.
Steps to start a Scribe server are described in the Scribe examples README 3. A simple scribe server configuration can be found in the Scribe examples 4.
LoggingTest will try to connect to a Scribe server at localhost:1463. To use a Scribe server at a different host or port, configure the host and port properties in scribe.composite to match your server.
Running the LoggingTest sample test program
To run the LoggingTest sample test program, do this:
Code Block |
---|
mvn -Dtest=LoggingTest test
|
Checking the Scribe log output
After running LoggingTest, you should find the logged string "Hello There" in file sample/sample_current under your Scribe log store directory.
If you've used the example1.conf Scribe configuration from the Scribe examples 4, you should find your log message in /tmp/scribetest/sample/sample_current.
1 http://wiki.github.com/facebook/scribe/
2 http://svn.apache.org/repos/asf/cassandra/trunk/lib/libthrift-r917130.jar
3 http://github.com/facebook/scribe/blob/master/examples/README
4 http://github.com/facebook/scribe/blob/master/examples/example1.conf
maven-osgi-junit
Note |
---|
|
Understand and Document |
calculator-osgi
Note |
---|
|
Understand and Document |
calculator-rest-osgi
Note |
---|
|
Understand and Document |
sca-client
Samples that demonstrate the OASIS defined SCA Client API being used in simple Java applications to access SCA components running in the domain.
calculator-scaclient
Disabled in this Beta1 release pending some up-coming changes in
the way that domains are addressed and accessed.
helloworld-scaclient
Disabled in this Beta1 release pending some up-coming changes in
the way that domains are addressed and accessed.
running-tuscany
Running something in Tuscany requires one or more contributions, and a method of launching the contributions to make the services they provide available. The sections below describes various means of launching contributions with the Tuscany SCA Java runtime. It's not important that you try all of these but they show you what's possible and hopefully show you how to use Tuscany in an environment that makes sense to you.
Some of the running-tuscany sub-directories just contain a README that gives you instructions. For example, maven just tells you how to configure and run contributions using the maven-tuscany-plugin. Others contain code. For example, embedded-jse contains simple Java launchers that show you how to start some of the sample contributions from a Java program.
The sample contributions in getting-started and learning-more should work regardless of which approach you adopt. However some approaches, like embedded-jse, don't have launchers for every single sample contribution.
command-line
You can execute a sample contribution from the command line on Windows or Linux.
Note |
---|
|
Waiting for tuscany.bat to be reworked before correcting |
To execute a sample contribution from the command line
on Windows, from a command prompt in the samples directory, run the command ...
Code Block |
---|
<tuscany_din_distro>\bin\tuscany.bat "contribution-name"
|
for example
Code Block |
---|
cd <tuscany_din_distro>\samples\learning-more\binding-sca\calculator-contribution
<tuscany_din_distro>\bin\tuscany.bat sample-binding-sca-calculator-contribution.jar
|
or on *nix platforms, from a shell prompt in the samples directory, run the command ...
Code Block |
---|
cd <tuscany_din_distro>/samples/learning-more/binding-sca/calculator-contribution
<tuscany_din_distro>/bin/tuscany.sh |
Panel |
---|
|
The contribution Jar can be built using Maven as follows: Code Block |
---|
cd learning-more/binding-ws/calculator-contribution
mvn
|
The contribution can be installed and the composite it contains run using Maven as follows Code Block |
---|
cd running-tuscany/embedded-jse
mvn
| This will run several contributions including the sample-binding-sca-calculator-contribution. |
contribution-helloworld-ws-sdo
This sample demonstrates an SCA reference that uses a web service binding which works with SDO. Instead if using JAXB style Java beans in the service interface they are replaced with SDO object.
Note |
---|
|
Sample not currently enabled - awaiting SDO support |
distributed-osgi
These samples demonstrate the execution of Tuscany contributions in a OSGI environment. In particular the two bundle project in this directory define calculator objects that communicate with one another using the mechanisms defined in the OSGi remote services specifications. Here the Tuscany SCA runtime provides dynamic service discovery functionality. The calculator objects are registered as services directly with the OSGi bundle context by the bundle activator. Under the covers SCA provides the remote service disovery features that allow OSGi registered service to discover and communicate with one another across two JVMs.
To run the sample each bundle must be build using maven and then loaded into a separate OSGi environment into which the Tuscany SCA runtime has already been installed (See "osgi" under running-tuscany)
dosgi-dynamic-calculator-operations
This bundle provides the calculator add, subtract, multiple, divide operations services.
Panel |
---|
|
The bundle Jar can be built using Maven as follows: Code Block |
---|
cd learning-more/distributed-osgi/dosgi-dynamic-calculator-operations
mvn
|
|
Note |
---|
|
projects should be called dosgi-dynamic-calculator-operations-bundle |
To run the bundle see "osgi" under running-tuscany. In short do the following:
On Windows, run
Code Block |
---|
java -jar ..\..\..\..\modules\osgi-3.5.0-v20090520.jar -configuration ..\..\..\..\features\configuration -clean -console
|
You should see the osgi console. You can run "ss" command under the osgi> to see the status of the bundles.
Then you can install and start the bundle that's just been built:
Code Block |
---|
osgi> install file:./target/sample-dosgi-dynamic-calculator-operations.jar
|
dosgi-dynamic-calculator
Panel |
---|
|
The bundle Jar can be built using Maven as follows: Code Block |
---|
cd learning-more/distributed-osgi/dosgi-dynamic-calculator
mvn
|
|
Note |
---|
|
projects should be called dosgi-dynamic-calculator-bundle |
To run the bundle see "osgi" under running-tuscany. In short do the following:
eclipse
To import sample contributions into Eclipse you first need to import the Tuscany runtime. You then need to import the sample contribution into Eclipse as a project. Instructions for doing both of these things can be found here
http://tuscany.apache.org/import-existing-tuscany-sca-projects-into-eclipse.html
Note. these instructions refer to our 1.x code base but it holds true for our 2.x code base.
Once you have a contribution imported into Eclipse and cleanly compiling against the Tuscany runtime jars you probably want to be able to run and debug it. The easiest way to do this is with a simple Java launcher. If you import the running-tuscany/embedded-jse project into Eclipse you'll see a number of such launcher programs which you can copy to launch the contribution(s) of your choice. Alternatively you can add a JUnit test case to the contribution that starts Tuscany and launches the contribution. See maven-junit as an example of how to do this.
embedded-jse
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.
Panel |
---|
|
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 |
---|
|
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 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 |
---|
|
To use the sample OSGI launchers with ant do the following: Code Block |
---|
cd embedded-osgi
ant <contributionname>
|
where <contributionname> is one of the targets in the build.xml file |
Panel |
---|
|
To use the sample JSE launchers from Maven do the following: Code Block |
---|
cd embedded-osgi
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:
Code Block |
---|
<plugin>
<groupId>org.apache.tuscany.maven.plugins</groupId>
<artifactId>maven-tuscany-plugin</artifactId>
<version>2.0-SNAPSHOT</version>
</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
mvn tuscany:run
This will install the contribution in the Tuscany runtime, start the composite it contains, 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/sca-client/calculator-scaclient.
maven-junit
Maven will run JUnit tests found in a module's src/test/java directory automatically. If you use embedded-jse style code in the JUnit test to install a contribution and start any composites it contains they you can unit test your contributions. This directory contains a contribution and a unit test which installs the contribution using very similar code to that found in embedded-jse.
To run the contributions unit test do the following:
Code Block |
---|
cd maven-junit/calculator-contribution
mvn
|
maven-junit-osgi
You can use a special Tuscany Maven plugin (maven-osgi-junit-plugin) to unit test contributions in a JUnit environment. This relies on adding some configuration to the Maven pom.xml. For example, if you look in maven-junit-osgi/calculator-osgi you'll see:
Code Block |
---|
<plugin>
<groupId>org.apache.tuscany.maven.plugins</groupId>
<artifactId>maven-osgi-junit-plugin</artifactId>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-node-launcher-equinox</artifactId>
<version>${pom.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>osgi-test</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<systemProperties>
<property>
<name>osgi.configuration.area</name>
<value>${project.build.directory}/equinox</value>
</property>
</systemProperties>
</configuration>
</execution>
</executions>
</plugin>
|
This configures the maven-osgi-junit-plugin to use the tuscany-node-launcher-equinox to install the contribution represented by the calculator-osgi directory. As an alternative to this configuration you could use the contents of tuscany-node-launcher-equinox directly in your JUnit test to launch the Tuscany runtime using OSGi.
To run the contributions unit test do the following:
Code Block |
---|
cd maven-junit/calculator-contribution
mvn
|
osgi
The Tuscany runtime can be run in a vanilla OSGi container such as Equinox. To do this you have to:
- launch the OSGi container itself
- load the Tuscany runtime bundles (all our jars are bundles) into the container
- install a contribution packaged as an OSGi bundle
For example, to install a contribution in Equinox do the following
On Windows, run
Code Block |
---|
java -jar ..\..\..\modules\osgi-3.5.0-v20090520.jar -configuration ..\..\..\features\configuration -clean -console
|
On *UnixOn Windows, run
Code Block |
---|
java -jar ..\/..\/..\..\modules\/modules/osgi-3.5.0-v20090520.jar -configuration ..\/..\/..\..\features\/features/configuration -clean -console
|
You should see the osgi console:
Code Block |
---|
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.
Then you can install and start the bundle that's just been builtand start contributions as bundles by doing the following:
Code Block |
---|
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
Running on Felix
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.
Note |
---|
|
We currently have two similar approaches available (see command-line). We need to merge the two together. |
To build the sample shell do this:
To run it:
at the prompt:
Code Block |
---|
start myNode ../../applications/store/target/sample-store.jar
|
or:
Code Block |
---|
start myNode http://people.apache.org/~jsdelfino/tuscany/java/test/sample-store.jar
|
also try:
Code Block |
---|
status
stop myNode
bye
|
Starting and stopping composites is pretty fast. To see that, try the following
two scripts, which start/stop the sample store composite 10 times.
Code Block |
---|
./sca <scripts/test.txt
|
or
Code Block |
---|
./sca <scripts/test-remote.txt
|
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
Tuscany can be embedded inside a webapp alongside one or more SCA contributions. 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
For example, for binding-jsonrpc/contribution-calculator-webapp, do the following:
Code Block |
---|
cd samples/binding-jsonrpc/contribution-calculator-webapp
mvn
cp target/sample-contribution-binding-jsonrpc-calculator-webapp.war <your_container_deployment-dir>
|
As an alternative, sample webapp based contributions can be run within Jetty directly from Maven, look for webapp contributions that have the following configuration in their pom.xml file:
Code Block |
---|
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.18</version>
</plugin>
|
For contributions that have this, for example, binding-jsonrpc/contribution-calculator-webapp, do the following
Code Block |
---|
cd samples/binding-sca/contribution-calculator
mvn jetty:run
|
This will launch the contribution in the Jetty runtime and then wait. At this point you can use HTTP clients to send messages to services that the running SCA applcation exposes. For this example try pointing your browser at:
Code Block |
---|
http://localhost:8080/sample-binding-jsonrpc-calculator-webapp/
|
You should see the calculator service start.
implementation-bpel
BPEL component implementations will be useful to those who wish to describe a sequence of calls that must be made to other component services.
contribution-helloworld-bpel
Panel |
---|
|
The contribution Jar can be built using Ant as follows: Code Block |
---|
cd learning-more/implementation-bpel/helloworld-bpel-contribution
ant
|
The contribution can be installed and the composite it contains run using Ant as follows: |
Panel |
---|
|
The contribution Jar can be built using Maven as follows: Code Block |
---|
cd learning-more/implementation-bpel/helloworld-bpel-contribution
mvn
|
The contribution can be installed and the composite it contains run using Maven as follows |
helloworld-bpel-webapp
implementation-composite
Note |
---|
|
Understand and Document |
helloworld-recursive
Note |
---|
|
Understand and Document |
helloworld-recursive-ws
Note |
---|
|
Understand and Document |
implementation-java
Note |
---|
|
Understand and Document |
contribution-calculator
Note |
---|
|
Understand and Document |
implementation.osgi
dosgi-calculator
dosgi-calculator-operations
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 |
maven-osgi-junit
Note |
---|
|
Understand and Document |
calculator-osgi
Note |
---|
|
Understand and Document |
calculator-rest-osgi
Note |
---|
|
Understand and Document |
sca-client
Note |
---|
|
Understand and Document |
calculator-scaclient
Note |
---|
|
Understand and Document |
helloworld-scaclient
Note |
---|
|
Understand and Document |
extending-tuscany
binding-extension
Note |
---|
|
Understand and Document |
implementation-extension
Note |
---|
|
Understand and Document |
applications
Note |
---|
|
Understand and Document |
store
Note |
---|
|
Understand and Document |
store-webapp
Note |
---|
|
Understand and Document |