summaryrefslogtreecommitdiffstats
path: root/sandbox/old/contrib/old-samples/standalone/calculator/readme.html
blob: 5fac063c10820ef9ef07958f4853656ab3e29668 (plain)
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.    
-->

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>Apache Tuscany Calculator Sample Application</title>
    <link rel="stylesheet" href="../../css/samples.css" type="text/css">
</head>
<body>
<h1>Apache Tuscany Calculator Sample Application</h1>

<p>
    This sample illustrates the use of SCA to wire components together inside a composite.
    All connections between the components are local and are defined using Java interfaces.
</p>

<h2>Setup</h2>
<p>
    Please install Apache Maven and build the library composites as described in the
    <a href="../../readme.html#GettingStarted">Getting Started</a> section of the root readme.
</p>

<h2>Building</h2>

<p>To build the sample run:</p>
  <pre class="command">
$ mvn package
</pre>
<p>
    This will build and package the code that calls the calculator composite from a
    command line client environment.
</p>

<h2>Running</h2>
<p>
    To run the client, use the <code>launcher</code> command from the standalone distribution:
</p>
<pre class="command">
$ java -jar {tuscany.installDir}/bin/launcher.jar target/calc.jar {add|subtract|multiply|divide} {param} {param}
</pre>

<p>where <code>tuscany.installDir</code> is the path where you installed the standalone distribution.</p>

<p>
    The sample when run will display to the standard output:
</p>
<pre class="command">
$ java -jar {tuscany.installDir}/bin/launcher.jar target/calc.jar add 2 5
result = 7.0
</pre>
</body>
</html>