summaryrefslogtreecommitdiffstats
path: root/site/trunk/site-publish/distributed-sca-domain.html
diff options
context:
space:
mode:
authorcoreyg <coreyg@13f79535-47bb-0310-9956-ffa450edef68>2014-11-21 09:30:19 +0000
committercoreyg <coreyg@13f79535-47bb-0310-9956-ffa450edef68>2014-11-21 09:30:19 +0000
commit200a40b332420f94992eb39a6d0ea1cf1490ffc4 (patch)
tree1c76ef1d254c7bfc91128a313d319bd60da9d01e /site/trunk/site-publish/distributed-sca-domain.html
parent85f53ab6ab4f664d63774c94b672a875c9e52b8a (diff)
Adding tuscany's website to their svn repo for svnpubsub
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1640879 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'site/trunk/site-publish/distributed-sca-domain.html')
-rw-r--r--site/trunk/site-publish/distributed-sca-domain.html421
1 files changed, 421 insertions, 0 deletions
diff --git a/site/trunk/site-publish/distributed-sca-domain.html b/site/trunk/site-publish/distributed-sca-domain.html
new file mode 100644
index 0000000000..7aa99478f9
--- /dev/null
+++ b/site/trunk/site-publish/distributed-sca-domain.html
@@ -0,0 +1,421 @@
+
+<!--
+
+ 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.
+-->
+
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<HTML>
+ <HEAD>
+ <!-- generateKeywords macro -->
+ <META name="description" content="Apache Tuscany">
+ <META name="keywords" content="apache, apache tuscany, tuscany, service, services, fabric, soa, service oriented architecture, sca, service component architecture, das, sdo, csa, ruby, opensource">
+ <!-- generateKeywords macro end -->
+
+ <LINK type="text/css" rel="stylesheet" href="http://tuscany.apache.org/stylesheets/default.css">
+ <LINK rel="SHORTCUT ICON" href="https://cwiki.apache.org/confluence/display/TUSCANY/$images/favicon.ico">
+ <TITLE>Apache Tuscany : Distributed SCA Domain</TITLE>
+ <META http-equiv="Content-Type" content="text/html;charset=UTF-8"></HEAD>
+
+ <BODY onload="init()">
+ <!-- topNav macro -->
+ <TABLE valign="top" border="0" cellspacing="0" cellpadding="0" width="100%" background="http://tuscany.apache.org/images/TuscanyLogoNEW_Text_120px_bg.jpg">
+ <TR>
+ <TD valing="top" align="left">
+ <A href="https://cwiki.apache.org/confluence/pages/viewpage.action?spaceKey=TUSCANY&title=$siteroot"><IMG src="http://tuscany.apache.org/images/TuscanyLogoNEW_Text_120px_bg.jpg" height="91" width="25" border="0"></A>
+ </TD>
+ <TD>
+ <A href="http://tuscany.apache.org/"><IMG src="http://tuscany.apache.org/images/TuscanyLogo.jpg" border="0"></A>
+ </TD>
+
+ <TD width="100%">
+ &nbsp;
+ </TD>
+
+ <!-- Adds the edit page link to the top banner-->
+ <TD valign="bottom">
+ <DIV style="padding: 2px 10px; margin: 0px;">
+ <A href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=66885">
+ <IMG src="http://tuscany.apache.org/images/notep_16.gif" height="16" width="16" border="0" align="absmiddle" title="Edit Page"></A>
+ </DIV>
+ </TD>
+
+ </TR>
+ </TABLE>
+ <!-- topNav macro end -->
+
+ <!-- breadCrumbs macro -->
+ <TABLE border="0" cellpadding="2" cellspacing="0" width="100%">
+ <TR class="topBar">
+ <TD align="left" valign="middle" class="topBarDiv" nowrap="true" width="100%">
+ &nbsp;<A href="home.html" title="Apache Tuscany">Apache Tuscany</A>&nbsp;&gt;&nbsp;<A href="home.html" title="Home">Home</A>&nbsp;&gt;&nbsp;<A href="sca-overview.html" title="SCA Overview">SCA Overview</A>&nbsp;&gt;&nbsp;<A href="sca-java.html" title="SCA Java">SCA Java</A>&nbsp;&gt;&nbsp;<A href="java-sca-documentation-menu.html" title="Java SCA Documentation Menu">Java SCA Documentation Menu</A>&nbsp;&gt;&nbsp;<A href="sca-java-user-guide.html" title="SCA Java User Guide">SCA Java User Guide</A>&nbsp;&gt;&nbsp;<A href="" title="Distributed SCA Domain">Distributed SCA Domain</A>
+ </TD>
+
+ <TD align="right" valign="middle" class="topBarDiv" align="left" nowrap="true">
+ <A href="http://mail-archives.apache.org/mod_mbox/tuscany-user">User List</A> | <A href="http://mail-archives.apache.org/mod_mbox/tuscany-dev">Dev List</A> | <A href="http://issues.apache.org/jira/browse/Tuscany">Issue Tracker</A>&nbsp;&nbsp;
+ </TD>
+ </TR>
+ </TABLE>
+ <!-- breadCrumbs macro end -->
+
+
+ <TABLE border="0" cellpadding="0" width="100%" bgcolor="#FFFFFF">
+ <TR>
+ <TD align="left" valign="top">
+
+ <!-- pageContent macro -->
+ <DIV id="PageContent">
+
+ <DIV class="pagecontent">
+ <DIV class="wiki-content">
+ <TABLE class="sectionMacroWithBorder" border="0" cellpadding="5" cellspacing="0" width="100%"><TBODY><TR>
+<TD class="confluenceTd" valign="top" width="15%">
+<DIV class="panel" style="background-color: #ECF4D1;border-color: #C3CDA1;border-style: solid;border-width: 1px;"><DIV class="panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #C3CDA1;background-color: #C3CDA1;"><B>General</B></DIV><DIV class="panelContent" style="background-color: #ECF4D1;">
+<P><A href="home.html" title="Home">Home</A><BR>
+<A href="http://www.apache.org/licenses/LICENSE-2.0.html" class="external-link" rel="nofollow">License </A><BR>
+<A href="sca-java-get-involved.html" title="SCA Java Get Involved">Get Involved</A><BR>
+<A href="sca-java-found-a-bug.html" title="SCA Java Found A Bug">Found a Bug?</A></P>
+</DIV></DIV>
+
+<DIV class="panel" style="background-color: #ECF4D1;border-color: #b4b4b5;border-style: solid;border-width: 1px;"><DIV class="panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #b4b4b5;background-color: #C3CDA1;"><B>SCA Java</B></DIV><DIV class="panelContent" style="background-color: #ECF4D1;">
+<P><A href="sca-java.html" title="SCA Java">SCA Java Home</A><BR>
+<A href="tuscany-dashboard.html" title="Tuscany Dashboard">SCA Dashboard</A><BR>
+<A href="java-sca-tools.html" title="Java SCA Tools">Tools </A><BR>
+<A href="tuscany-sca-java-faq.html" title="Tuscany SCA Java - FAQ">FAQ</A></P>
+</DIV></DIV>
+
+<DIV class="panel" style="background-color: #ECF4D1;border-color: #b4b4b5;border-style: solid;border-width: 1px;"><DIV class="panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #b4b4b5;background-color: #C3CDA1;"><B>SCA Java 1.x</B></DIV><DIV class="panelContent" style="background-color: #ECF4D1;">
+<P><A href="sca-java-releases.html" title="SCA Java Releases">Downloads</A><BR>
+<A href="java-sca-documentation-menu.html" title="Java SCA Documentation Menu">Documentation</A><BR>
+<A href="https://svn.apache.org/repos/asf/tuscany/sca-java-1.x/trunk/" class="external-link" rel="nofollow">1.x Source Code</A><BR>
+<A href="http://tinyurl.com/8rlxd3" class="external-link" rel="nofollow">Roadmap</A></P>
+</DIV></DIV>
+
+<DIV class="panel" style="background-color: #ECF4D1;border-color: #b4b4b5;border-style: solid;border-width: 1px;"><DIV class="panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #b4b4b5;background-color: #C3CDA1;"><B>SCA Java 2.x</B></DIV><DIV class="panelContent" style="background-color: #ECF4D1;">
+<P><A href="sca-java-2x-releases.html" title="SCA Java 2.x Releases">Downloads</A><BR>
+<A href="http://tuscany.apache.org/documentation-2x/" class="external-link" rel="nofollow">Documentation</A><BR>
+<A href="https://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/" class="external-link" rel="nofollow">2.x Source Code</A><BR>
+<A href="http://tinyurl.com/8rlxd3" class="external-link" rel="nofollow">Roadmap</A></P>
+</DIV></DIV>
+
+
+<DIV class="panel" style="background-color: #ECF4D1;border-color: #b4b4b5;border-style: solid;border-width: 1px;"><DIV class="panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #b4b4b5;background-color: #C3CDA1;"><B>Documentation</B></DIV><DIV class="panelContent" style="background-color: #ECF4D1;">
+<P><A href="sca-java-user-guide.html" title="SCA Java User Guide">User Guide</A><BR>
+<A href="sca-java-architecture-guide.html" title="SCA Java Architecture Guide">Architecture Guide</A><BR>
+<A href="sca-java-development-guide.html" title="SCA Java Development Guide">Developer Guide</A><BR>
+<A href="sca-java-extension-development-guide.html" title="SCA Java Extension Development Guide">Extension Developer Guide</A></P>
+</DIV></DIV>
+
+<DIV class="panel" style="background-color: #ECF4D1;border-color: #b4b4b5;border-style: solid;border-width: 1px;"><DIV class="panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #b4b4b5;background-color: #C3CDA1;"><B>Resources</B></DIV><DIV class="panelContent" style="background-color: #ECF4D1;">
+<P><A href="tuscany-sca-java-faq.html" title="Tuscany SCA Java - FAQ">FAQ</A><BR>
+<A href="https://svn.apache.org/repos/asf/incubator/tuscany/java/sca" class="external-link" rel="nofollow">Source Code</A></P>
+</DIV></DIV>
+</TD>
+<TD class="confluenceTd" valign="top" width="85%">
+
+<H1><A name="DistributedSCADomain-CreateADistributedApplication"></A>Create A Distributed Application</H1>
+
+<P>An SCA assembly can be run in a single or multi-node environment. Here we introduce the Tuscany node and SCA domain and explain how the calculator example can be distributed across multiple nodes. </P>
+
+<H2><A name="DistributedSCADomain-Nodes"></A>Nodes</H2>
+
+<P>Node is a Tuscany specific term (you won't find it in the OASIS SCA specifications). The node wraps the Tuscany SCA runtime. The runtime comprises the modules that are present in the modules directory of the Tuscany SCA Java distribution. As you might expect there are functions that read XML, create an in memory model of the SCA assembly, create the components and wire them together ready to process incoming messages. </P>
+
+<P>A node runs an SCA assembly described by one or more composite files. A node runs in a single JVM. You can start more than one node in a single JVM if you need to but we only tend to do this for testing purposes. In the first section of the user guide we built a <A href="http://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/samples/calculator/" class="external-link" rel="nofollow">calculator sample</A> that included Calculator, Add, Subtract, Multiply and Divide components included in a single composite. </P>
+
+<P><SPAN class="image-wrap" style="display: block; text-align: center"><IMG src="distributed-sca-domain.data/calculator2.png" style="border: 0px solid black"></SPAN></P>
+
+<P>The composite was run using the following API;</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+ node = SCANodeFactory.newInstance().createSCANodeFromClassLoader(<SPAN class="code-quote">&quot;Calculator.composite&quot;</SPAN>, getClass().getClassLoader());
+ node.start();
+</PRE>
+</DIV></DIV>
+
+<P>This loads the named composite, and any associated resources, and then starts the node to start up all of the components within the composite. </P>
+
+<H3><A name="DistributedSCADomain-ConfiguringNodes"></A>Configuring Nodes</H3>
+
+<P>Creating a node in code is straightforward. For example,</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+SCANode2 node = SCANodeFactory.newInstance().createSCANodeFromClassLoader(<SPAN class="code-quote">&quot;calculator.composite&quot;</SPAN>, <SPAN class="code-keyword">null</SPAN>);
+</PRE>
+</DIV></DIV>
+<P>Here the &quot;null&quot; parameter means that the node factory uses the current class' classloader to locate the named composite file. The location of the composite file is assumed to be the location of the SCA contribution. The assumption here is that only one contribution is required. </P>
+
+<P>If more contributions must be loaded by the node the following interface can be used.</P>
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+SCANode2 node = SCANodeFactory.newInstance().createSCANode(<SPAN class="code-quote">&quot;file:/C:/CalculatorContribution1/Calculator.composite&quot;</SPAN>,
+ <SPAN class="code-keyword">new</SPAN> SCAContribution(<SPAN class="code-quote">&quot;CalculatorContribution1&quot;</SPAN>,
+ <SPAN class="code-quote">&quot;file:/C:/CalculatorContribution1&quot;</SPAN>),
+ <SPAN class="code-keyword">new</SPAN> SCAContribution(<SPAN class="code-quote">&quot;CalculatorContribution2&quot;</SPAN>,
+ <SPAN class="code-quote">&quot;file:/C:/CalculatorContribution2&quot;</SPAN>));
+</PRE>
+</DIV></DIV>
+<P>Where</P>
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+<SPAN class="code-quote">&quot;file:/C:/CalculatorContribution1/Calculator.composite&quot;</SPAN>
+</PRE>
+</DIV></DIV>
+<P>Is the explicit location of the composite file to be run and</P>
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+<SPAN class="code-keyword">new</SPAN> SCAContribution(<SPAN class="code-quote">&quot;CalculatorContribution1&quot;</SPAN>,
+ <SPAN class="code-quote">&quot;file:/C:/CalculatorContribution1&quot;</SPAN>)
+</PRE>
+</DIV></DIV>
+<P>Shows how to provide contribution details. The first parameter &quot;CalculatorContribution1&quot; gives a name for the contribution. The second parameter tells the node where to find the contribution. As this second parameter is a URL the contribution can be read from disk or directly from the network. </P>
+
+<P>Using multiple contributions can be useful if, for example, you have chosen to separate common artifacts from those specific to this composite. The contribution containing common artifacts can then be used in other SCA applications without change.</P>
+
+<H3><A name="DistributedSCADomain-StartingaNode"></A>Starting a Node</H3>
+
+<P>Once the node is created it is configured and ready to be started. It can be started as follows.</P>
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+node.start();
+</PRE>
+</DIV></DIV>
+
+<H3><A name="DistributedSCADomain-LocatingServices"></A>Locating Services</H3>
+
+<P>If the node has been created from within a piece of Java code using the node fatory interface a local service reference can be retrieved in the following way.</P>
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+calculatorService = ((SCAClient)node).getService(CalculatorService.class, <SPAN class="code-quote">&quot;CalculatorServiceComponent&quot;</SPAN>);
+</PRE>
+</DIV></DIV>
+
+<P>One a node has been started all of its remote bindings will be active so you can also access the component services that the node contains via any remote bindings that they define. </P>
+
+<H3><A name="DistributedSCADomain-StoppingaNode"></A>Stopping a Node</H3>
+
+<P>If you are done with the node or need to stop it processing messages use the following.</P>
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+node.stop();
+</PRE>
+</DIV></DIV>
+
+
+<H2><A name="DistributedSCADomain-SCADomain"></A>SCA Domain</H2>
+
+<P>When running standalone a node defines the scope of component services that references can target by name. SCA defines the term SCA Domain to describe this scope. Section 10 of the SCA Assembly specification actually describes an SCA Domain as defining &quot;the boundary of visibility for all SCA mechanisms&quot;.</P>
+
+<P>In a standalone node a reference can only target services that are running within the same node. However nodes running in separate JVMs can be configured to run an SCA assembly in a distributed fashion. In this way components running on one node can reference components running on a separate node. To make this configuration work the nodes must be running as part of the same distributed SCA domain. In Tuscany a distributed SCA domain is represented using a separate domain manager process. </P>
+
+<H3><A name="DistributedSCADomain-Creatingcompositestorunacrossmultiplenodes."></A>Creating composites to run across multiple nodes. </H3>
+<P>From the <A href="http://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/samples/calculator/" class="external-link" rel="nofollow">calculator sample</A> you can see that the wires between the component references and services, formed by adding a target component name to a reference, are resolved inside an SCA domain comprising a single node. </P>
+
+<P><SPAN class="image-wrap" style="display: block; text-align: center"><IMG src="distributed-sca-domain.data/calculator2.png" style="border: 0px solid black"></SPAN></P>
+
+<P>For example, this section of the calculator composite file shows how the CalcuatorServiceComponent targets the AddServiceComponent.</P>
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+&lt;composite xmlns=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//www.osoa.org/xmlns/sca/1.0&quot;</SPAN>
+</SPAN> targetNamespace=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//sample&quot;</SPAN>
+</SPAN> xmlns:sample=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//sample&quot;</SPAN>
+</SPAN> name=<SPAN class="code-quote">&quot;Calculator&quot;</SPAN>&gt;
+ &lt;component name=<SPAN class="code-quote">&quot;CalculatorServiceComponent&quot;</SPAN>&gt;
+ &lt;implementation.java class=<SPAN class="code-quote">&quot;calculator.CalculatorServiceImpl&quot;</SPAN>/&gt;
+ &lt;reference name=<SPAN class="code-quote">&quot;addService&quot;</SPAN> target=<SPAN class="code-quote">&quot;AddServiceComponent&quot;</SPAN> /&gt;
+ &lt;reference name=<SPAN class="code-quote">&quot;subtractService&quot;</SPAN> target=<SPAN class="code-quote">&quot;SubtractServiceComponent&quot;</SPAN> /&gt;
+ &lt;reference name=<SPAN class="code-quote">&quot;multiplyService&quot;</SPAN> target=<SPAN class="code-quote">&quot;MultiplyServiceComponent&quot;</SPAN> /&gt;
+ &lt;reference name=<SPAN class="code-quote">&quot;divideService&quot;</SPAN> target=<SPAN class="code-quote">&quot;DivideServiceComponent&quot;</SPAN> /&gt;
+ &lt;/component&gt;
+
+ &lt;component name=<SPAN class="code-quote">&quot;AddServiceComponent&quot;</SPAN>&gt;
+ &lt;implementation.java class=<SPAN class="code-quote">&quot;calculator.AddServiceImpl&quot;</SPAN>/&gt;
+ &lt;/component&gt;
+
+ ...
+&lt;/composite&gt;
+</PRE>
+</DIV></DIV>
+<P>The target=&quot;AddServiceComponent&quot; of the CalculatorServiceComponent's addService reference refers to the AddServiceComponent defined later on in this composite. A single composite must run on a single node so to distribute this application we need to separate it into more than one composite.</P>
+
+<P>In the <A href="http://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/samples/calculator-distributed/" class="external-link" rel="nofollow">distributed calculator</A> sample the composite defines the calculator component but not the add component;</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+&lt;composite xmlns=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//www.osoa.org/xmlns/sca/1.0&quot;</SPAN>
+</SPAN> targetNamespace=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//sample&quot;</SPAN>
+</SPAN> xmlns:sample=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//sample&quot;</SPAN>
+</SPAN> name=<SPAN class="code-quote">&quot;Calculator&quot;</SPAN>&gt;
+ &lt;component name=<SPAN class="code-quote">&quot;CalculatorServiceComponent&quot;</SPAN>&gt;
+ &lt;implementation.java class=<SPAN class="code-quote">&quot;calculator.CalculatorServiceImpl&quot;</SPAN>/&gt;
+ &lt;reference name=<SPAN class="code-quote">&quot;addService&quot;</SPAN> target=<SPAN class="code-quote">&quot;AddServiceComponent&quot;</SPAN> /&gt;
+ &lt;reference name=<SPAN class="code-quote">&quot;subtractService&quot;</SPAN> target=<SPAN class="code-quote">&quot;SubtractServiceComponent&quot;</SPAN> /&gt;
+ &lt;reference name=<SPAN class="code-quote">&quot;multiplyService&quot;</SPAN> target=<SPAN class="code-quote">&quot;MultiplyServiceComponent&quot;</SPAN> /&gt;
+ &lt;reference name=<SPAN class="code-quote">&quot;divideService&quot;</SPAN> target=<SPAN class="code-quote">&quot;DivideServiceComponent&quot;</SPAN> /&gt;
+ &lt;/component&gt;
+
+ ...
+&lt;/composite&gt;
+</PRE>
+</DIV></DIV>
+
+<P>Another composite defines the add component. </P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+&lt;composite xmlns=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//www.osoa.org/xmlns/sca/1.0&quot;</SPAN>
+</SPAN> targetNamespace=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//sample&quot;</SPAN>
+</SPAN> xmlns:sample=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//sample&quot;</SPAN>
+</SPAN> name=<SPAN class="code-quote">&quot;Add&quot;</SPAN>&gt;
+
+ &lt;component name=<SPAN class="code-quote">&quot;AddServiceComponent&quot;</SPAN>&gt;
+ &lt;implementation.java class=<SPAN class="code-quote">&quot;calculator.AddServiceImpl&quot;</SPAN>/&gt;
+ &lt;/component&gt;
+
+ ...
+&lt;/composite&gt;
+</PRE>
+</DIV></DIV>
+
+<P>These two composites are run by separate nodes within the context of a single domain and the calculator addService reference </P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+&lt;reference name=<SPAN class="code-quote">&quot;addService&quot;</SPAN> target=<SPAN class="code-quote">&quot;AddServiceComponent&quot;</SPAN> /&gt;
+</PRE>
+</DIV></DIV>
+
+<P>is still be able to find the add component running on a separate node. </P>
+
+<P><SPAN class="image-wrap" style="display: block; text-align: center"><IMG src="distributed-sca-domain.data/calculator3.png" style="border: 0px solid black"></SPAN></P>
+
+<P>So a distributed SCA domain can consist of more than one node/composite and wires can run between components defined in the separate composites. </P>
+
+<H3><A name="DistributedSCADomain-StartingADomain"></A>Starting A Domain</H3>
+
+<P>There is a launcher that has a mainline for starting the domain. For example, </P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+ <SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">static</SPAN> void main(<SPAN class="code-object">String</SPAN>[] args) <SPAN class="code-keyword">throws</SPAN> Exception {
+ DomainManagerLauncher.main(args);
+ }
+</PRE>
+</DIV></DIV>
+
+<P>In the <A href="http://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/samples/calculator-distributed/" class="external-link" rel="nofollow">calculator-distributed</A> sample this code is contained in the class node.LaunchDomain.java. Runing this will run the domain mananger. </P>
+
+<P>This <A href="http://www.ibm.com/developerworks/webservices/library/ws-sca-tuscany/index.html?S_TACT=105AGX04&S_CMP=EDU" class="external-link" rel="nofollow">article</A> that is hosted outside of Tuscany provides a step by step instruction for how to use the Tuscany web-based domain manager UI to administer an SCA domain and how to use the domain administrative UI to deploy an SOA solution comprised of SCA components.</P>
+
+<H3><A name="DistributedSCADomain-ConfiguringADomainThroughTheDomainManagerWebInterface"></A>Configuring A Domain Through The Domain Manager Web Interface</H3>
+
+<P>Once the domain manager is running you can get to the web interface of the default domain by pointing your browser at <A href="http://localhost:9990/ui" class="external-link" rel="nofollow">http://localhost:9990/ui</A>. This provides a number of different pages allowing you to </P>
+
+<UL>
+ <LI>Add contributions to the domain</LI>
+ <LI>Add node configurations to the domain</LI>
+ <LI>Configure composites to run on specific nodes</LI>
+ <LI>Start local node instances to test the configuration</LI>
+</UL>
+
+
+<P>When you start the domain manager for the distributed calculator sample you will see the pages already populated with the information needed to execture the sample. </P>
+
+<H3><A name="DistributedSCADomain-ConfiguringaDomainThroughTheFileSystem"></A>Configuring a Domain Through The File System</H3>
+
+<P>Behind the domain manager web application there are three files where the configuration information is stored. </P>
+
+<P><B>workspace.xml</B> - stores the ID and location of each contribution that has been added to the domain.</P>
+
+<P><B>domain.composite</B> - the virtual domain composite. This is an SCA composite that represents the virtual domain which includes all of the composites that will run in the domain. A URI is provided which indicates which contribution each composite comes from. Ultimately an SCANode instance will be started for each composite included in the virtual domain. Each SCANode instance can be running on separate/distributed processors. So the virtual domain is a consolidated description of you distributed SCA application</P>
+
+<P><B>cloud.composite</B> - describes the compute cloud (the set of distributed SCANode instances) being used to run the SCA application. Each node is assigned a composite and also has details of the configuration of bindings when they run on that node, for example, the root URI is set. It's possibly slightly confusing that this file is in SCA composite format also but this is a convenience because firstly we didn't have to create a new file format and secondly there may be some benefit in the future of representing this network of nodes as a network of SCA services for management purposes although we don't do that yet.</P>
+
+<P>These files are updated when you make changes to the domain through the domain manager interface but they have a fairly simple XML format and can be edited manually or new utilities could be constructed to edit them automatically. In the distributed calculator sample you can find these files in the root directory. </P>
+
+<H3><A name="DistributedSCADomain-ConnectiontononSCAservices"></A>Connection to non-SCA services</H3>
+
+<P>To connect to services outside of the SCA Domain (whether they be services provided by SCA or by other means) you can still configure an explicit binding, for example, lets now assume that the DivideServiceComponent is a non-sca web service out there on the network somewhere. As this is outside the SCA domain we can use an explicit remote binding to talk to it.</P>
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+&lt;component name=<SPAN class="code-quote">&quot;CalculatorServiceComponent&quot;</SPAN>&gt;
+ &lt;implementation.java class=<SPAN class="code-quote">&quot;calculator.CalculatorServiceImpl&quot;</SPAN>/&gt;
+ &lt;reference name=<SPAN class="code-quote">&quot;addService&quot;</SPAN> &gt;&lt;/reference&gt;
+ &lt;reference name=<SPAN class="code-quote">&quot;subtractService&quot;</SPAN> target=<SPAN class="code-quote">&quot;SubtractServiceComponent&quot;</SPAN>&gt;&lt;/reference&gt;
+ &lt;reference name=<SPAN class="code-quote">&quot;multiplyService&quot;</SPAN> target=<SPAN class="code-quote">&quot;MultiplyServiceComponent&quot;</SPAN>&gt;&lt;/reference&gt;
+ &lt;reference name=<SPAN class="code-quote">&quot;divideService&quot;</SPAN> target=<SPAN class="code-quote">&quot;DivideServiceComponent&quot;</SPAN>&gt;
+ &lt;binding.ws uri=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//localhost:8080/sample-calculator-ws-webapp/AddServiceComponent&quot;</SPAN>/&gt;
+</SPAN> &lt;/reference&gt;
+ &lt;/component&gt;
+</PRE>
+</DIV></DIV>
+
+<H3><A name="DistributedSCADomain-StartingNodesInADistributedDomain"></A>Starting Nodes In A Distributed Domain</H3>
+
+<P>The domain manager is used to pre-process each composited prior to the composites being deployed to nodes for running. Contributions (containing the composites) are added to the domain manager. Configuration must be provided which tells the domain manager where the nodes are that are going to run the composites and which composites they will run. Based on this information the domain manager makes an atom feed available for each composite that is deployed to a node. The node to which the composite is assigned must read the correct atom feed in order to configure itself by downloading the composite to run and the contributions required provide the artifacts required by the composite. There is a Node API that takes as input the URL of an atom feed exposed by the domain manager as follows. </P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+SCANode2 node = SCANodeFactory.newInstance().createSCANodeFromURL(<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//localhost:9990/node-config/NodeA&quot;</SPAN>);</SPAN>
+</PRE>
+</DIV></DIV>
+
+<P>The URL <A href="http://localhost:9990/node-config/NodeA" class="external-link" rel="nofollow">http://localhost:9990/node-config/NodeA</A> is the URL of the atom feed that the domain manager provides.</P>
+
+<P>The domain manager processes all the relationships between all composite components and provides a fully configured composite to each node, i.e. all of the binding URIs are filled out correctly so it's basically a pre-processing step.</P>
+
+<P>In the <A href="http://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/samples/calculator-distributed/" class="external-link" rel="nofollow">calculator-distributed</A> sample java classes are provided which are set up ready to start the required nodes. Look at the files.</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+node.LaunchCalculatorNodeA
+node.LaunchCalculatorNodeB
+node.LaunchCalculatorNodeC
+</PRE>
+</DIV></DIV>
+
+<P>The README provided with the samples gives more detailed instruction on how to run the sample.</P>
+</TD></TR></TBODY></TABLE>
+ </DIV>
+ </DIV>
+ </DIV>
+ <!-- pageContent macro end -->
+
+ </TD>
+ </TR>
+ </TABLE>
+
+ <!-- footer macro -->
+ <SCRIPT src="http://www.google-analytics.com/urchin.js" type="text/javascript">
+ </SCRIPT>
+ <SCRIPT type="text/javascript">
+ _uacct = "UA-1174707-5";
+ urchinTracker();
+ </SCRIPT>
+
+ <A href="http://www.statcounter.com/" target="_blank"><IMG src="http://c26.statcounter.com/counter.php?sc_project=2619156&java=0&security=94bd7e7d&invisible=0" alt="website stats" border="0"></A>
+
+ <DIV class="footer">
+ Copyright � 2003-2012, The Apache Software Foundation&nbsp;&nbsp;</BR>
+ Apache Tuscany and the Apache Tuscany project logo are trademarks of The Apache Software Foundation.
+ </DIV>
+ <!-- footer macro end -->
+
+ </BODY>
+</HTML>