summaryrefslogtreecommitdiffstats
path: root/sca-java-1.x/branches
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-1.x/branches')
-rw-r--r--sca-java-1.x/branches/sca-java-1.6.1/samples/calculator-corba-reference/README84
-rw-r--r--sca-java-1.x/branches/sca-java-1.6.1/samples/calculator-corba-service/README93
2 files changed, 149 insertions, 28 deletions
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/samples/calculator-corba-reference/README b/sca-java-1.x/branches/sca-java-1.6.1/samples/calculator-corba-reference/README
index 66c4cddb94..384c8774f4 100644
--- a/sca-java-1.x/branches/sca-java-1.6.1/samples/calculator-corba-reference/README
+++ b/sca-java-1.x/branches/sca-java-1.6.1/samples/calculator-corba-reference/README
@@ -1,23 +1,48 @@
Calculator CORBA Reference Sample
-===============================
+=================================
-This sample illustrates the use of Tuscany CORBA Binding to call reference
+This sample illustrates the use of the Tuscany CORBA Binding to reference
services that are hosted as CORBA services.
The README in the samples directory (the directory above this) provides
general instructions about building and running samples. Take a look there
first.
+If you just want to run it to see what happens open a command prompt, first
+navigate to the calculator-corba-service sample and do:
+
+ant run
+
+OR if you don't have ant, on Windows do
+
+java -cp ..\..\lib\tuscany-sca-manifest.jar;target\sample-calculator-corba-service.jar calculator.CalculatorCORBAServer
+
+and on *nix do
+
+java -cp ../../lib/tuscany-sca-manifest.jar:target/sample-calculator-corba-service.jar calculator.CalculatorCORBAServer
+
+Now you have the server running you need to open another command prompt, navigate
+to this sample directory and do:
+
+ant run
+
+OR if you don't have ant, on Windows do
+
+java -cp ..\..\lib\tuscany-sca-manifest.jar;target\sample-calculator-corba-reference.jar calculator.CalculatorClient
+
+and on *nix do
+
+java -cp ../../lib/tuscany-sca-manifest.jar:target/sample-calculator-corba-reference.jar calculator.CalculatorClient
Sample Overview
---------------
This sample extends the calculator sample by replacing the local wired
connections with CORBA bindings. Instead of local add, subtract, multiply and
-divide components, an CORBA service implementation now provides the
+divide components, a CORBA service implementation now provides the
add, subtract, multiply and divide interfaces and is hosted as an CORBA object.
References specified in the .composite file include a CORBA binding which targets
-this CORBA object. Name service which is used in CORBA communication is provided
-in test case class - CalculatorCORBAReferenceTestCase.java.
+this CORBA object. The name service which is used in CORBA communication is
+provided in the test case class - CalculatorCORBAReferenceTestCase.java.
This sample adds a number of classes to the basic calculator sample:
@@ -29,7 +54,7 @@ calculator-corba-reference/
CalculatorService.java - as calculator sample
AddService.java - as calculator sample
SubtractService.java - as calculator sample
- MultipleService.java - as calculator sample
+ MultiplyService.java - as calculator sample
DivideService.java - as calculator sample
CalculatorClient.java - as calculator sample
CalculatorServiceImpl.java - calls the CORBA service
@@ -43,20 +68,56 @@ calculator-corba-reference/
CalculatorCORBAReferenceTestCase.java - JUnit test case
CalculatorCORBAServant.java - CORBA service implementation
idl/ - contains files generated
- from IDL file. Files are
- used to create CORBA object which
- will be consumed by SCA reference.
+ from the IDL file. Files are
+ used to create a CORBA object which
+ will be consumed by SCA references.
_CalculatorCORBAServiceImplBase.java
CalculatorCORBAService.java
CalculatorCORBAServiceOperations.java
resources/
- CalculatorCORBA.idl - IDL description for CORBA object
+ CalculatorCORBA.idl - IDL description for CORBA object
pom.xml - the Maven build file
Note. As this test creates and uses local network connections you may need to
configure your firewall, if you are running one, to allow the test to run
successfully.
+Building And Running The Sample Using Ant
+-----------------------------------------
+With the binary distribution the sample can be built and run using Ant.
+
+The calculator-corba-service sample provides a CORBA server that acts as a target
+for the SCA CORBA binding. Start a new console and use the following commands.
+
+cd calculator-corba-service
+ant compile
+ant run
+
+This will run up the server and display the following.
+
+run:
+ [java] Calculator CORBA server started (press enter to shutdown)
+
+The client is very similar to the calculator sample. It starts the SCA runtime
+and calls each of the calculator operations. In doing this the CORBA binding
+makes calls out to the CORBA server you started in the previous step. Start
+a new console and use the following commands.
+
+cd calculator-corba-reference
+ant compile
+ant run
+
+You should see the following output from the run target.
+
+run:
+ [java] 3 + 2=5.0
+ [java] 3 - 2=1.0
+ [java] 3 * 2=6.0
+ [java] 3 / 2=1.5
+
+If you now return to the console window running the server and press enter the
+server should stop.
+
Building And Running The Sample Using Maven
-------------------------------------------
With either the binary or source distributions the sample can be built and run
@@ -78,6 +139,3 @@ Results :
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
This shows that the Junit test cases have run successfully.
-
-
-
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/samples/calculator-corba-service/README b/sca-java-1.x/branches/sca-java-1.6.1/samples/calculator-corba-service/README
index 87863752cd..965c1e7ad1 100644
--- a/sca-java-1.x/branches/sca-java-1.6.1/samples/calculator-corba-service/README
+++ b/sca-java-1.x/branches/sca-java-1.6.1/samples/calculator-corba-service/README
@@ -1,24 +1,49 @@
Calculator CORBA Service Sample
-=============================
+===============================
-This sample illustrates the use of Tuscany CORBA Binding to expose component
-services as CORBA objects. It also demonstrates how a simple Java CORBA
-Client application invokes the SCA Application's services exposed as CORBA
-Services.
+This sample illustrates the use of the Tuscany CORBA Binding to expose
+component services as CORBA objects. It also demonstrates how a simple
+Java CORBA Client application invokes the SCA Application's services
+exposed as CORBA objects.
The README in the samples directory (the directory above this) provides
general instructions about building and running samples. Take a look there
first.
+If you just want to run it to see what happens open a command prompt, navigate
+to this sample directory and do:
+
+ant run
+
+OR if you don't have ant, on Windows do
+
+java -cp ..\..\lib\tuscany-sca-manifest.jar;target\sample-calculator-corba-service.jar calculator.CalculatorCORBAServer
+
+and on *nix do
+
+java -cp ../../lib/tuscany-sca-manifest.jar:target/sample-calculator-corba-service.jar calculator.CalculatorCORBAServer
+
+Now you have the server running you need to open another command prompt, navigate
+to the calculator-corba-reference sample directory and do:
+
+ant run
+
+OR if you don't have ant, on Windows do
+
+java -cp ..\..\lib\tuscany-sca-manifest.jar;target\sample-calculator-corba-reference.jar calculator.CalculatorClient
+
+and on *nix do
+
+java -cp ../../lib/tuscany-sca-manifest.jar:target/sample-calculator-corba-reference.jar calculator.CalculatorClient
Sample Overview
---------------
This sample extends the calculator sample by replacing the local service
-binding with an CORBA binding. So a java client can call the service exposed
-by the SCA application using an CORBA client. Name service which is used in
-CORBA communication is provided by Tuscany CORBA hosting module
-(maven dependency: tuscany-host-corba-jse-tns) - see CORBA binding reference
-on Apache Tuscany website for details.
+binding with a CORBA binding. A Java client can use CORBA client code to
+call the service exposed by the SCA application. The name service which is
+used in CORBA communication is provided by the Tuscany CORBA hosting module
+(maven dependency: tuscany-host-corba-jse-tns) - see the binding.corba reference
+on the Apache Tuscany website for details.
This sample adds a number of classes to the basic calculator sample:
@@ -42,23 +67,61 @@ calculator-corba-service/
test/
java/
calculator/
- CalculatorCORBAServerTestCase.java - JUnit test case
- idl/ - contains files generated
- from IDL file. Files are
- used to access SCA component.
+ CalculatorCORBAServerTestCase.java - JUnit test case
+ idl/ - contains files generated
+ from the IDL file. Files are
+ used to access the SCA component.
CalculatorCORBAServiceHelper.java
CalculatorCORBAService.java
_CalculatorCORBAServiceStub.java
CalculatorCORBAServiceHolder.java
CalculatorCORBAServiceOperations.java
resources/
- CalculatorCORBA.idl - IDL description for SCA component
+ CalculatorCORBA.idl - IDL description for SCA component
pom.xml - the Maven build file
Note. As this test creates and uses local network connections you may need to
configure your firewall, if you are running one, to allow the test to run
successfully.
+Building And Running The Sample Using Ant
+-----------------------------------------
+With the binary distribution the sample can be built and run using Ant. Two
+build files are used to support client and server functions.
+
+The server starts the SCA runtime and loads the SCA calculator application
+which exposes a CORBA service. Start a new console and use the following
+commands.
+
+cd calculator-corba-service
+ant compile
+ant run
+
+This will run up the server and display the following.
+
+run:
+ [java] Calculator CORBA server started (press enter to shutdown)
+
+The client is very similar to the calculator sample
+
+It locates the CORBA service that the SCA runtime is exposing and calls each of
+the calculator operations. Start a new console and use the following commands.
+
+cd calculator-corba-reference
+ant compile
+ant run
+
+You should see the following output from the run target.
+
+run:
+ [java] 3 + 2=5.0
+ [java] 3 - 2=1.0
+ [java] 3 * 2=6.0
+ [java] 3 / 2=1.5
+
+If you now return to the console window running the server and press enter the
+server should stop.
+
Building And Running The Sample Using Maven
-------------------------------------------
With either the binary or source distributions the sample can be built and run