...
This demo can be used with any DOSGi distribution, in this document the single-bundle distribution (1.1) is used with iPOJO 1.6.0 and Felix (2.0.5)
Div | ||||||
---|---|---|---|---|---|---|
| ||||||
| ||||||
Wiki Markup | ||||||
{div:class=toc}
{toc:maxLevel=4|minLevel=2}
{div} |
Demo design
This demo is quite similar to the DS demo of DOSGi demo in structure. It consists of 5 bundles:
...
So let's install the server side in Felix. Launch Felix from the felix
directory with:
Div | ||
---|---|---|
| ||
java -jar | ||
Wiki Markup | ||
{div:class=shell}
java -jar bin/felix.jar server {div} |
Once the shell prompt appears, execute the following command in the shell:
Div | ||
---|---|---|
| ||
start | ||
Wiki Markup | ||
{div:class=shell}
start file:../AdderServiceInterface/target/AdderServiceInterface-0.0.1-SNAPSHOT.jar
file:../AdderServiceProvider/target/AdderServiceProvider-0.0.1-SNAPSHOT.jar {div} |
At this point, the service should be available remotely (wait until the console stops printing stuff), you can check this by obtaining the WSDL: http://localhost:9090/adder?wsdl
...
Now, let's start another instance of Felix:
Div | ||
---|---|---|
| ||
java -jar | ||
Wiki Markup | ||
{div:class=shell}
java -jar bin/felix.jar client {div} |
Then, execute the following command in the shell:
Div | ||
---|---|---|
| ||
start | ||
Wiki Markup | ||
{div:class=shell}
start file:../AdderServiceInterface/target/AdderServiceInterface-0.0.1-SNAPSHOT.jar
file:../AdderServiceConsumer/target/AdderServiceConsumer-0.0.1-SNAPSHOT.jar
file:../AdderServiceImporter/target/AdderServiceImporter-0.0.1-SNAPSHOT.jar ... log messages may appear, after a little while the following message appears:
adder service: 1 + 1 = 2 {div} |
The remote adder service has now been invoked. You will see the following line on the server side window:
...