1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
|
Building the travel sample using ant
------------------------------------
1. Download and unzip JDK 6 update 7 (or later) or JDK 5 update 22, and set
the JAVA_HOME environment variable to the JDK base directory.
2. Install svn and ant.
3. Create a local directory to hold the travel sample code. With this as
your current directory, check out the complete travel sample from svn
using the following command:
svn co http://svn.apache.org/repos/asf/tuscany/sca-java-1.x/trunk/tutorials/travelsample
4. Download and unzip the Tuscany SCA Java 1.6 (or later) binary distribution
and set the TUSCANY_HOME environment variable to the base directory
containing the unzipped binary distribution.
5. Download and unzip the OpenEJB 3.1.2 (or later) binary distribution and set
the OPENEJB_HOME environment variable to the base directory containing
the unzipped binary distribution.
6. If you are using JDK 5, download and unzip the JAX-WS reference implementation
version 2.1.7 and set the JAXWS_HOME environment variable to the base directory
containing the unzipped download.
7. With the travelsample directory as your current directory, enter the
command "ant compile".
Building the travel sample using maven
--------------------------------------
Most of the steps are similar to the above. For completeness, a full list
of the steps needed is given here.
1. Download and unzip JDK 6 update 7 (or later) or JDK 5 update 22, and set
the JAVA_HOME environment variable to the JDK base directory.
2. Install svn and maven.
3. Create a local directory to hold the travel sample code. With this as
your current directory, check out the complete travel sample from svn
using the following command:
svn co http://svn.apache.org/repos/asf/tuscany/sca-java-1.x/trunk/tutorials/travelsample
4. Check the setting of the <tuscany.version> property in the
travelsample/pom.xml file. If you want to build the travel sample using
a different Tuscany version, change this property as necessary. The
travel sample has been tested and runs correctly with Tuscany SCA Java 1.6.
5. With the travelsample directory as your current directory, enter the
command "mvn". You will need a live internet connection so that maven
can download any required files to your local repository.
6. By default the maven build produces a binary distribution that is an
add-on delta to the Tuscany SCA Java 1.6 binary distribution. If you
want to produce a fully self-contained binary distribution for the
travel sample, you can use the command "mvn -Pselfcontained" instead
of "mvn" to do this.
Running the travel sample from the build directories
----------------------------------------------------
The travel sample consists of a number of related scenarios. These scenarios
are listed below, together with instructions for running them. The instructions
in this section will work irrespective of whether the travel sample was built
using ant or maven.
Most of the scenarios are run by opening a single command prompt window
and entering the command "ant run" into that window. If a scenario is
listed with multiple commands, this means that it needs multiple command
prompt windows. In this case, each of the listed commands must be entered
into its own separate command prompt window in the order shown.
Before running these scenarios, you need to perform the setup described above
in "Building the travel sample using ant" if you have not already done this.
For each scenario, the following are given:
Directory: the current directory for the command prompt window or windows
Command(s): the command or commands for running the scenario
Contributions: SCA contributions used in this scenario
Launchers: other launcher directories used in this scenario, if any
Services: non-SCA services used in this scenario, if any
Clients: non-SCA clients used in this scenario, if any
1) Jumpstart - First simple example of using Tuscany
Directory: launchers/jumpstart
Command: ant run
Contributions: introducing-trips
2) Introducing - Simplified introduction to the travel application
Directory: launchers/introducing
Command: ant run
Contributions: introducing-client, introducing-tours, introducing-trips
3) Introducing (distributed) - Distributed services with a domain manager
Directory: launchers/introducing-client
Commands: ant run-domain, ant run-trips, ant run-tours, ant run
Contributions: introducing-client, introducing-tours, introducing-trips
Launchers: introducing-domain, introducing-tours, introducing-trips
4) Interaction - Different SCA interaction styles
Directory: launchers/interaction
Command: ant run
Contributions: calendar, common, currency, flight, hotel, interaction-client,
interaction-service-remote, shoppingcart
5) Full application - The full interactive travel application
Directory: launchers/fullapp
Command: ant run
Contributions: car, common, creditcard-payment-jaxb-policy, currency, flight,
fullapp-bespoketrip, fullapp-coordination, fullapp-currency, fullapp-packagedtrip,
fullapp-shoppingcart, fullapp-ui, hotel, payment-java-policy, scatours,
shoppingcart, travelcatalog, trip, tripbooking
6) Full application (distributed) - Distributed services with a domain manager
Directory: launchers/fullapp-nodes
Commands: ant run-domain, ant run
Contributions: car, common, creditcard-payment-jaxb, currency, flight,
fullapp-bespoketrip, fullapp-coordination, fullapp-currency, fullapp-packagedtrip,
fullapp-shoppingcart, fullapp-ui, hotel, payment-java, scatours,
shoppingcart, travelcatalog, trip, tripbooking
Launchers: fullapp-domain
7) Building blocks - Using SCA composites as application building blocks
Directory: launchers/buildingblocks
Commands: ant run
Contributions: buildingblocks, buildingblocks-client, introducing-trips
8) Blog feed
Directory: launchers/blog-feed
Command: ant run
Contributions: blog-feed
9) Data binding
Directory: launchers/databinding
Command: ant run
Contributions: creditcard-payment-sdo, databinding-client, payment-java
10) Feed logger
Directory: launchers/feed-logger
Command: ant run
Contributions: feed-logger
11) Help pages
Directory: launchers/help-pages
Command: ant run
Contributions: help-pages
12) Policy
Directory: launchers/policy
Command: ant run
Contributions: creditcard-payment-jaxb-policy, policy-client, payment-java-policy
13) Payment service with different implementation types
13a) implementation.bpel
Directory: launchers/payment-bpel
Command: ant run
Contributions: payment-bpel, creditcard-payment-jaxb, emailgateway
13b) implementation.script written in Groovy
Directory: launchers/payment-groovy
Command: ant run
Contributions: payment-groovy, creditcard-payment-jaxb, emailgateway
13c) implementation.java
Directory: launchers/payment-java
Command: ant run
Contributions: payment-java, creditcard-payment-jaxb
13d) implementation.java with policy
Directory: launchers/payment-java-policy
Command: ant run
Contributions: payment-java-policy, creditcard-payment-jaxb-policy
13e) implementation.spring
Directory: launchers/payment-spring
Command: ant run
Contributions: payment-spring, creditcard-payment-jaxb
13f) implementation.spring with SCA tags
Directory: launchers/payment-spring-scatag
Command: ant run
Contributions: payment-spring-scatag, creditcard-payment-jaxb
14) SCA currency converter service interoperating with SCA or non-SCA client
14a) SCA client
Directory: launchers/currency-converter
Command: ant run
Contributions: currency
14b) CORBA client
Directory: launchers/currency-converter-corba
Commands: ant run, ant run-client
Contributions: currency, currency-corba
Clients: currency-converter-corba
14c) JMS client
Directory: launchers/currency-converter-jms
Commands: ant run, ant run-client
Contributions: currency, currency-jms
Clients: currency-converter-jms
14d) RMI client
Directory: launchers/currency-converter-rmi
Commands: ant run, ant run-client
Contributions: currency, currency-rmi
Clients: currency-converter-rmi
14e) JAX-WS client
Directory: launchers/currency-converter-ws
Commands: ant run, ant run-client
Contributions: currency, currency-ws
Clients: currency-converter-ws-jaxws
15) SCA notification service interoperating with non-SCA SMS gateway service
15a) SMS gateway CORBA service
Directory: launchers/notification-corba
Commands: ant run-smsgateway, ant run
Contributions: notification, notification-corba
Services: smsgateway-corba
15b) SMS gateway EJB service
Directory: launchers/notification-ejb
Commands: ant run-smsgateway, ant run
Contributions: notification, notification-ejb
Services: smsgateway-ejb
15c) SMS gateway JMS service
Directory: launchers/notification-jms
Commands: ant run-smsgateway, ant run
Contributions: notification, notification-jms
Services: smsgateway-jms
15d) SMS gateway RMI service
Directory: launchers/notification-rmi
Commands: ant run-smsgateway, ant run
Contributions: notification, notification-rmi
Services: smsgateway-rmi
15e) SMS gateway JAX-WS service
Directory: launchers/notification-ws
Commands: ant run-smsgateway, ant run
Contributions: notification, notification-ws
Services: smsgateway-jaxws
Running the travel sample from the distribution directories
-----------------------------------------------------------
If the travel sample was built using maven, a binary distribution
directory will be created containing all the built jar files, together with
some directories containing runtime dependencies for these jar files.
The following directories contain the jar files for the travel sample:
clients - non-SCA clients using various communication technologies
contributions - SCA contributions for the travel sample
launchers - executable launchers for the travel sample
services - non-SCA services using various communication technologies
util - jar files needed by other jars in the travel sample
The following directories contain runtime dependencies of the above jar files:
domainconfig - domain configuration files
jaxws - JAX-WS runtime jars neeed when running the travel sample on JDK 5
lib - Tuscany runtime jars and their dependencies needed by the travel sample
(only present if the travel sample was built using "mvn -Pselfcontained")
openejb - OpenEJB 3.1.2 runtime jars needed by the travel sample
You can run each of the scenarios from the binary distribution by running one
or more jar files using ant scripts that are included in the binary distribution.
The ant commands that you need to use for running each scenario are listed below.
If multiple ant commands are listed for a scenario, they must be run in
separate processes in the order listed. The current directory when invoking
the ant command must be set as follows:
launchers/scatours-launcher-*.jar are run from the launchers directory
clients/scatours-client-*.jar are run from the clients directory
services/scatours-service-*.jar are run from the services directory
To run a jar, you need to used the command "ant run-jarsuffix" where
"jarsuffix" is the last part of the jar file name omitting the standard prefix
"scatours-client", "scatours-launcher" or "scatours-service". For example,
to run the "jumpstart" scenario, you would set your current directory to the
binary distribution "launchers" directory and run the command
ant run-jumpstart
This runs the travel sample jar file scatours-launcher-jumpstart.jar using a
classpath with the required runtime dependencies from the Tuscany SCA binary
distribution. The location of the Tuscany SCA binary distribution is specified
by the TUSCANY_HOME environment variable).
If the travel sample binary distribution was built using the "mvn -Pselfcontained"
command, you can use the "java -jar" command to run the travel sample executable
jars directly as an alternative to using ant scripts. For example, instead of
using the command
ant run-jumpstart
you can use the command
java -jar scatours-launcher-jumpstart.jar
Here is a complete list of the ant commands to run the scenarios described above
from the travel sample binary distribution. These are run from the "launchers"
directory unlesss otherwise indicated.
1) Jumpstart - First simple example of using Tuscany
ant run-jumpstart
2) Introducing - Simplified introduction to the travel application
ant run-introducing
3) Introducing (distributed) - Distributed services with a domain manager
ant run-introducing-domain
ant run-introducing-trips
ant run-introducing-tours
ant run-introducing-client
4) Interaction - Different SCA interaction styles
ant run-interaction
5) Full application - The full interactive travel application
jant run-fullapp
6) Full application (distributed) - Distributed services with a domain manager
ant run-fullapp-domain
ant run-fullapp-nodes
7) Building blocks - Using SCA composites as application building blocks
ant run-buildingblocks
8) Blog feed
ant run-blog-feed
9) Data binding
ant run-databinding
10) Feed logger
ant run-feed-logger
11) Help pages
ant run-help-pages
12) Policy
ant run-policy
13) Payment service with different implementation types
13a) implementation.bpel
ant run-payment-bpel
13b) implementation.script written in Groovy
ant run-payment-groovy
13c) implementation.java
ant run-payment-java
13d) implementation.java with policy
ant run-payment-java-policy
13e) implementation.spring
ant run-payment-spring
13f) implementation.spring with SCA tags
ant run-payment-spring-scatag
14) SCA currency converter service interoperating with SCA or non-SCA client
14a) SCA client
ant run-currency-converter
14b) CORBA client
ant run-currency-converter-corba
ant run-currency-converter-corba (from "clients" directory)
14c) JMS client
ant run-currency-converter-jms
ant run-currency-converter-jms (from "clients" directory)
14d) RMI client
ant run-currency-converter-rmi
ant run-currency-converter-rmi (from "clients" directory)
14e) JAX-WS client
ant run-currency-converter-ws
ant run-currency-converter-ws-jaxws (from "clients" directory)
15) SCA notification service interoperating with non-SCA SMS gateway service
15a) SMS gateway CORBA service
ant run-smsgateway-corba (from "services" directory)
ant run-notification-corba
15b) SMS gateway EJB service
ant run-smsgateway-ejb (from "services" directory)
ant run-notification-ejb
15c) SMS gateway JMS service
ant run-smsgateway-jms (from "services" directory)
ant run-notification-jms
15d) SMS gateway RMI service
ant run-smsgateway-rmi (from "services" directory)
ant run-notification-rmi
15e) SMS gateway JAX-WS service
ant run-smsgateway-jaxws (from "services" directory)
ant run-notification-ws
Cross-reference of contributions to scenarios
---------------------------------------------
The following table shows which contributions are used in which scenarios.
contributions/blog-feed 8
contributions/buildingblocks 7
contributions/buildingblocks-client 7
contributions/calendar 4
contributions/car 5, 6
contributions/common 4, 5, 6
contributions/creditcard-payment-jaxb 6, 13a, 13b, 13c, 13e, 13f
contributions/creditcard-payment-jaxb-policy 5, 12, 13d
contributions/creditcard-payment-sdo 9
contributions/creditcard-payment-webapp **not used**
contributions/currency 4, 5, 6, 14a, 14b, 14c, 14d
contributions/currency-corba 14b
contributions/currency-jms 14c
contributions/currency-jsp **not used**
contributions/currency-rmi 14d
contributions/currency-servlet **not used**
contributions/currency-ws 14e
contributions/databinding-client 9
contributions/emailgateway 13a, 13b
contributions/feed-logger 10
contributions/flight 4, 5, 6
contributions/fullapp-bespoketrip 5, 6
contributions/fullapp-coordination 5, 6
contributions/fullapp-currency 5, 6
contributions/fullapp-packagedtrip 5, 6
contributions/fullapp-shoppingcart 5, 6
contributions/fullapp-ui 5, 6
contributions/help-pages 11
contributions/hotel 5, 6
contributions/interaction-client 4
contributions/interaction-service-remote 4
contributions/introducing-client 2, 3
contributions/introducing-tours 2, 3
contributions/introducing-trips 1, 2, 3, 7
contributions/notification 15a, 15b, 15c, 15d
contributions/notification-corba 15a
contributions/notification-ejb 15b
contributions/notification-jms 15c
contributions/notification-rmi 15d
contributions/payment-bpel 13a
contributions/payment-groovy 13b
contributions/payment-java 6, 9, 13c
contributions/payment-java-policy 5, 12, 13d
contributions/payment-spring 13e
contributions/payment-spring-policy **not used**
contributions/payment-spring-scatag 13f
contributions/policy-client 12
contributions/scatours 5, 6
contributions/shoppingcart 4, 5, 6
contributions/travelcatalog 5, 6
contributions/trip 5, 6
contributions/tripbooking 5, 6
|