...
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
Notepanel | ||
---|---|---|
| ||
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 |
...
| ||||
The contribution Jar can be built using Ant as follows:
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:
The contribution can be installed and the composite it contains run using Maven as follows
This will run several contributions including the sample-implementation-java-calculator-contribution. |
implementation.osgi
dosgi-calculator
Panel | ||
---|---|---|
| ||
The bundle Jar can be built using Maven as follows:
|
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
...
title | TODO |
---|
...
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.
Code Block |
---|
osgi> ss
|
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:
|
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.
Code Block |
---|
osgi> ss
|
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 bundle Jar can be built using Maven as follows:
|
Panel | ||||
---|---|---|---|---|
| ||||
The contribution Jar can be built using Ant as follows:
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 bundle Jar can be built using Maven 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:
|
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 |
...