Versions Compared

Key

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

...

In the following text we us <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.

Instructions are colour coded as follows:

Panel
bgColorpink

Instructions in pink boxes are for the Ant user

Panel
bgColorsilver

Instructions in silver boxes are for the Maven user

Table of Contents
minLevel2
outlinetrue

...

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

Warning
titleTODO

Needs review/completion

contribution-calculator-reference (for binding-rmi)

This contribution serves the purpose of accessing the services of the calculator service contribution, in particular defining a reference that uses the add service of that contribution using the RMI protocol.

contribution-calculator-service (for binding-rmi)

...

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
bgColorpink

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
bgColorsilver

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

contribution-calculator-service

This contribution defines a CalculatorServiceComponent whose add, subtract, multiply and divide operations are available over RMI.

Panel
bgColorpink

The contribution Jar can be built using Ant as follows:

Code Block

cd learning-more/binding-rmi/calculator-service-contribution
ant
Panel
bgColorsilver

The contribution Jar can be built using Maven as follows:

Code Block

cd learning-more/binding-rmi/calculator-service-contribution
mvn

contribution-calculator-reference

This contribution defines a CalculatorServiceComponent which accesses the service version of the component using binding.rmi.

Panel
bgColorpink

The contribution Jar can be built using Ant as follows:

Code Block

cd learning-more/binding-rmi/calculator-reference-contribution
ant
Panel
bgColorsilver

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 components. 

...