tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Tuscany: Distributed SCA Domain (page edited)
Date Fri, 28 Sep 2007 10:03:00 GMT
Distributed SCA Domain (TUSCANY) edited by Simon Laws
      Page: http://cwiki.apache.org/confluence/display/TUSCANY/Distributed+SCA+Domain
   Changes: http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=66885&originalVersion=1&revisedVersion=2


{include: SCA Java Subproject Menu}
{include: Java SCA Menu New}

{note:title:Notification}{center}This page is under construction\- You are welcome to help
and complete it{center}{note}

h1. Distributed SCA Domain

Using a distributed SCA domain that works across multiple JVMs is not much harder than using
the [Standalone SCA Domain].


Here each running node has a representation of the domain so we create an instance of 


Note that the package name is different compared to the standalone SCA domain. This time we
are dealing with a distributed domain rather than a standalone domain. 

Again there are a number of newInstance() operations to choose from. The first two are the
same as in the standalone case

public static SCADomain newInstance() 

Starts a standalone domain with a default domain URI and will treat the classpath as the contribution
to this domain.  All .composite files on the classpath will will read any deployable components
created accordingly. 

Deployable components are defined by either

1/ placing the .composite file in the  META-INF/sca-deployables/directory
2/ By specifying the composite as deployable in the META-INF/sca-contribution.xml file
    public static SCADomain newInstance(String composite)

Starts a standalone domain with a default domain URI and will try and find the named composite
file in the classpath and use it's location as the contribution location. It will deploy the
named composite. 

The third variation has changed to take account of the distributed domain.

public static SCADomain newInstance(String domainURI, String nodeURI, String contributionLocation,
String... composites)

This starts a local node with the identifier "nodeURI". This must be a unique uri that identifies
this node. If this uri is a valid url of the form http://hostname:portnumber/  it is used
by the node implementation as the root address for the management services that the node starts

In the future, when distributed domain support has been enabled in webapps, this will also
indicate to SCA what the host name and port number of the web app container is. 

The domainURI is the URL of the domain manager. This is a separate java application that the
nodes contact in order to register service information and in order to find information about
other services in the domain.

The contributionLocation and composite parameters are as before. 

When the node starts is will load the contribution, deploy any deployable composites and then
register information about any external services with the domain manager. 

We can see how this works by taking a look at the calculator-distributed sample. 


We have a sample domain manager implementation in the calculator-distributed sample. If you
go to the sample you can run this using the following command

ant runDomainNode

This starts some domain management services at the endpoint http://myhost:8877. So the domain
name in this case is http://myhost:8877.

If you take a look at node.CalculatorNode.java you can see how each node in the domain is

SCADomain scaDomain = SCADomain.newInstance(domainName, nodeName, null, nodeName + "/Calculator.composite");

Where domainName will be "http://myhost:8877" and the node name will be "nodeA" or "nodeB"
or "nodeC". In the calculator-distributed sample you can start the node implementation using
the ant build file again, for example

ant RunNode http://localhost:8877 nodeB

Once started we can used the SCADomain interface as before. For example, a service proxy can
be created and an operation called. 

CalculatorService calculatorService = scaDomain.getService(CalculatorService.class, "CalculatorServiceComponent");
double result = calculatorService.add(3, 2));

Putting this all together the following picture gives an idea of what is going on under the



This message is automatically generated by Confluence

Unsubscribe or edit your notifications preferences

If you think it was sent incorrectly contact one of the administrators

If you want more information on Confluence, or have a bug to report see

To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org

View raw message