You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

(lightbulb) This page is in progress. It is currently a paste of Simon Laws email on distribution that explains some of the code path. Goal is to provide developers with a quick walk through of key methods so that they can get started coding/debugging. Please help update this page. Thanks.

Bit of background needed to answer this so bear with me. Inside the node
(EmbeddedNode) it uses a local domain implementation (EmbeddedSCADomain)
that holds all of the parts of the runtime together.

           domain = new EmbeddedSCADomain(cl, domainName);
           domain.start();

In fact it uses two at the moment. One to hold the application components
that you want to run and one to run any management components there might
be. At the moment the only management component is a proxy to the remote
service registry but I left this management domain in so that I didn't have
to hand craft service clients for management purposes.

You can get various things from the EmbeddedSCADoamin, for example, you see
the code getting a contribution service and adding a contribution to it.

           ContributionService contributionService =
domain.getContributionService();
           Contribution contribution = contributionService.contribute("
http://calculator",
                                                         contributionURL,
                                                         null, //resolver,
                                                         false);

Contributions are the collections of resources that describe your services,
e.g. .composite files, xsd files, wsdl files etc. The act of contributing
this information results in an in memory assembly model (see the assembly
module).

            Composite composite = contribution.getDeployables().get(0);

The root of which is a composite which contains a hierarchy of components
that you want to run. Then various steps are taken to turn the logical
assembly model into runnable artifacts so that the components can be
started. The model composite gets added to a top level composite that the
local domain controls.

           domain.getDomainComposite().getIncludes().add(composite);

Then there is a build stage where the parts of the logical model are linked
together, references to services etc.

           domain.getCompositeBuilder().build(composite);

Then there is a step where information is provided to the runtime so that
remote services can be resolved automatically across the network. I.e. we
link to guts of the assembly model into the notion of a distributed domain.

           distributedDomain.addDistributedDomainToBindings(composite);

Then finally the runtime artifacts are created based on the logical model,
these include the service endpoints and clients.

           domain.getCompositeActivator().activate(composite);

Once all this is done, each component in the domain can be started
independently

           for (Composite composite :
domain.getDomainComposite().getIncludes()
){
               domain.getCompositeActivator().start(composite);
           }
  • No labels