summaryrefslogtreecommitdiffstats
path: root/sca-java-1.x/branches/sca-java-1.6.1/samples
diff options
context:
space:
mode:
authornash <nash@13f79535-47bb-0310-9956-ffa450edef68>2010-09-23 18:39:23 +0000
committernash <nash@13f79535-47bb-0310-9956-ffa450edef68>2010-09-23 18:39:23 +0000
commitcb7e2134e7c391c37771cf1bc8cdba110023ebae (patch)
treeafa79268d77558fede97bbf09cb62faeb06d2367 /sca-java-1.x/branches/sca-java-1.6.1/samples
parent3821341cff4577890f2c2cb24be591815ee29cc5 (diff)
TUSCANY-3684: Update README file to describe building and running the sample using ant
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1000571 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-1.x/branches/sca-java-1.6.1/samples')
-rw-r--r--sca-java-1.x/branches/sca-java-1.6.1/samples/domain-management/README251
1 files changed, 141 insertions, 110 deletions
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/samples/domain-management/README b/sca-java-1.x/branches/sca-java-1.6.1/samples/domain-management/README
index 540cbc3bc0..eb31bb07ad 100644
--- a/sca-java-1.x/branches/sca-java-1.6.1/samples/domain-management/README
+++ b/sca-java-1.x/branches/sca-java-1.6.1/samples/domain-management/README
@@ -6,82 +6,33 @@ analyze and resolve contribution dependencies given a set of available contribut
The README in the samples directory (the directory above this) provides
general instructions about building and running samples. Take a look there first.
-Sample Overview
----------------
-
-This sample demonstrates how to use some of the APIs for processing the contributions.
-These APIs are currently used under the cover in the domain manager.
-
-domain-management/
- src/
- main/
- java/
- manager/
- DistributeAndRunComponents.java
- DistributeComponents.java
- ListComponents.java
- ListDependencies.java
- ListDeployables.java
- WireComponents.java
- resources/
- test/
- java/
- services/
- Cart.java
- Item.java
- ShoppingCartClientImpl.java
- ShoppingCartImpl.java
- resources/
- assembly/
- assets.xml
- client.xml
- store.xml
- assets/
- META-INF/
- sca-contribution.xml
- client/
- META-INF/
- client.composite
- store/
- META-INF/
- sca-contribution.xml
- store.composite
- build.xml
- pom.xml
- README
-
-Building the Sample Using Maven
--------------------------------------------
-
-cd domain-management
-mvn
-
-** Please note that the mvn command will just build the sample and will install the required jar files into the Maven repository.
-** In order to run the sample, please see the instructions - "Running the Sample"
+If you want to run this sample to see what happens, open a command prompt, navigate
+to this sample directory and run any of the sample domain management tasks
+as follows:
Running the Sample
------------------
-** Please make sure that sample is built using above build command(s).
-
-This sample implements following sample domain management tasks:
-
1. List deployables in a contribution:
------------------------------------
- This sample reads the SCA metadata for two sample contributions and prints the names of their deployable composites.
- Use the following command to run the sample:
-
- On windows do:
- java -cp ..\..\lib\tuscany-sca-manifest.jar;target\sample-domain-management.jar manager.ListDeployables
- On *nix do:
- java -cp ../../lib/tuscany-sca-manifest.jar:target/sample-domain-management.jar manager.ListDeployables
+ ant runListDeployables
+
+ - OR if you don't have ant,
+
+ On windows do:
+ java -cp ..\..\lib\tuscany-sca-manifest.jar;target\sample-domain-management.jar manager.ListDeployables
+
+ On *nix do:
+ java -cp ../../lib/tuscany-sca-manifest.jar:target/sample-domain-management.jar manager.ListDeployables
- You should see the following output:
-
- Deployable: {http://store}store
+
+ Deployable: {http://store}store
2. List contribution dependencies:
--------------------------------
@@ -90,19 +41,23 @@ This sample implements following sample domain management tasks:
- Use the following command to run the sample:
- On windows do:
- java -cp ..\..\lib\tuscany-sca-manifest.jar;target\sample-domain-management.jar manager.ListDependencies
-
- On *nix do:
- java -cp ../../lib/tuscany-sca-manifest.jar:target/sample-domain-management.jar manager.ListDependencies
+ ant runListDependencies
+
+ - OR if you don't have ant,
+
+ On windows do:
+ java -cp ..\..\lib\tuscany-sca-manifest.jar;target\sample-domain-management.jar manager.ListDependencies
+
+ On *nix do:
+ java -cp ../../lib/tuscany-sca-manifest.jar:target/sample-domain-management.jar manager.ListDependencies
- You should see the following output:
- Contribution: store
- dependency: assets
- dependency: store
- Contribution: assets
- dependency: assets
+ Contribution: store
+ dependency: assets
+ dependency: store
+ Contribution: assets
+ dependency: assets
3. Add deployables to a domain composite and wire them:
-----------------------------------------------------
@@ -115,56 +70,132 @@ This sample implements following sample domain management tasks:
- Use the following command to run the sample:
- On windows do:
- java -cp ..\..\lib\tuscany-sca-manifest.jar;target\sample-domain-management.jar manager.WireComponents
+ ant runWireComponents
+
+ - OR if you don't have ant,
+
+ On windows do:
+ java -cp ..\..\lib\tuscany-sca-manifest.jar;target\sample-domain-management.jar manager.WireComponents
- On *nix do:
- java -cp ../../lib/tuscany-sca-manifest.jar:target/sample-domain-management.jar manager.WireComponents
+ On *nix do:
+ java -cp ../../lib/tuscany-sca-manifest.jar:target/sample-domain-management.jar manager.WireComponents
- You should see the following output:
-
- <?xml version="1.0" encoding="UTF-8"?>
- <composite name="domain" targetNamespace="http://sample"
- xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:ns1="http://www.osoa.org/xmlns/sca/1.0">
- <component name="ShoppingCart" uri="ShoppingCart">
- <implementation.java class="services.ShoppingCartImpl"/>
- <service name="Cart">
- <ns2:binding.atom name="Cart" uri="/ShoppingCart/Cart" xmlns:ns2="http://tuscany.apache.org/xmlns/sca/1.0"/>
- </service>
- </component>
- <component name="ShoppingCartClient" uri="ShoppingCartClient">
- <implementation.java class="services.ShoppingCartClientImpl"/>
- <service name="Cart">
- <ns2:binding.atom name="Cart" uri="/ShoppingCartClient/Cart" xmlns:ns2="http://tuscany.apache.org/xmlns/sca/1.0"/>
- </service>
- <reference name="cart">
- <ns2:binding.atom name="cart#ShoppingCart/Cart"
- uri="/ShoppingCart/Cart" xmlns:ns2="http://tuscany.apache.org/xmlns/sca/1.0"/>
- </reference>
- </component>
- </composite>
+
+ <?xml version="1.0" encoding="UTF-8"?>
+ <composite name="domain" targetNamespace="http://sample"
+ xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:ns1="http://www.osoa.org/xmlns/sca/1.0">
+ <component name="ShoppingCart" uri="ShoppingCart">
+ <implementation.java class="services.ShoppingCartImpl"/>
+ <service name="Cart">
+ <ns2:binding.atom name="Cart" uri="/ShoppingCart/Cart" xmlns:ns2="http://tuscany.apache.org/xmlns/sca/1.0"/>
+ </service>
+ </component>
+ <component name="ShoppingCartClient" uri="ShoppingCartClient">
+ <implementation.java class="services.ShoppingCartClientImpl"/>
+ <service name="Cart">
+ <ns2:binding.atom name="Cart" uri="/ShoppingCartClient/Cart" xmlns:ns2="http://tuscany.apache.org/xmlns/sca/1.0"/>
+ </service>
+ <reference name="cart">
+ <ns2:binding.atom name="cart#ShoppingCart/Cart"
+ uri="/ShoppingCart/Cart" xmlns:ns2="http://tuscany.apache.org/xmlns/sca/1.0"/>
+ </reference>
+ </component>
+ </composite>
4. List Components:
-----------------
-
+
- This sample reads the SCA metadata for two sample contributions, and displays their dependencies, reads and resolve
the artifacts contained in the contributions, and finally prints the deployables composites and the components
they declare as well as their main characteristics (showing that their interfaces and implementations are actually resolved).
- Use the following command to run the sample:
- On windows do:
- java -cp ..\..\lib\tuscany-sca-manifest.jar;target\sample-domain-management.jar manager.ListComponents
+ ant runListComponents
+
+ - OR if you don't have ant,
+
+ On windows do:
+ java -cp ..\..\lib\tuscany-sca-manifest.jar;target\sample-domain-management.jar manager.ListComponents
- On *nix do:
- java -cp ../../lib/tuscany-sca-manifest.jar:target/sample-domain-management.jar manager.ListComponents
+ On *nix do:
+ java -cp ../../lib/tuscany-sca-manifest.jar:target/sample-domain-management.jar manager.ListComponents
- You should see the following output:
- Deployable: {http://store}store
- component: ShoppingCart
- componentService: Cart
- binding: class org.apache.tuscany.sca.binding.atom.impl.AtomBindingImpl - /ShoppingCart/Cart
- implementation: services.ShoppingCartImpl
- service: Cart
- interface: services.Cart
+ Deployable: {http://store}store
+ component: ShoppingCart
+ componentService: Cart
+ binding: class org.apache.tuscany.sca.binding.atom.impl.AtomBindingImpl - /ShoppingCart/Cart
+ implementation: services.ShoppingCartImpl
+ service: Cart
+ interface: services.Cart
+
+
+Sample Overview
+---------------
+
+This sample demonstrates how to use some of the APIs for processing contributions.
+These APIs are currently used under the covers in the domain manager.
+
+domain-management/
+ src/
+ main/
+ java/
+ manager/
+ DistributeAndRunComponents.java
+ DistributeComponents.java
+ ListComponents.java
+ ListDependencies.java
+ ListDeployables.java
+ WireComponents.java
+ resources/
+ test/
+ java/
+ services/
+ Cart.java
+ Item.java
+ ShoppingCartClientImpl.java
+ ShoppingCartImpl.java
+ resources/
+ assembly/
+ assets.xml
+ client.xml
+ store.xml
+ assets/
+ META-INF/
+ sca-contribution.xml
+ client/
+ META-INF/
+ client.composite
+ store/
+ META-INF/
+ sca-contribution.xml
+ store.composite
+ build.xml
+ pom.xml
+ README
+
+
+Building And Running The Sample Using Ant
+-----------------------------------------
+With the binary distribution the sample can be built and run using Ant as
+follows:
+
+cd domain-management
+ant compile
+ant runListDeployables
+ant runListDependencies
+ant runWireComponents
+ant runListComponents
+
+
+Building the Sample Using Maven
+-------------------------------
+
+cd domain-management
+mvn
+
+** Please note that the mvn command will just build the sample and will install the required jar files into the Maven repository.
+** In order to run the sample, please see the instructions - "Running the Sample"