With the changes associated with
http://issues.apache.org/jira/browse/TUSCANY-1338 I've now put the simple
distributed runtime support into head. The modules I've added are

modules/
 topology/topology-xml - describe and read the node to component mapping
(not actually used at the moment)
 binding.sca - provides and abstraction of a automatically configured
remote runtime
 distributed - the various other infrastructure changes I needed
samples/
 calculator-distributed

Fundamentally what is going on is that there is a new domain class
DistributesSCADomain which has two runtimes in it.

1/ A DistributedRuntime which runs the application assembly
2/ A NodeRuntime which runs the node management services, at this time just
the ComponentRegistry.

The ComponentRegistry implements a simple interface which allows the
component/node mapping to be set and retrieved. Currently it is set from har
coded calls in the sample but as this is in an SCA assmebly any kind of
binding can be used for getting the information in.

The distributed module is worth a closer look. I've added the distributed
support without changing any of the existing runtime code and this is where
I've put the new bits and pieces. If you look inside this module you see the
following packages that map onto our existing packages. Code could be moved
to the right place in the future.

o.a.t.s.d.assembly
  The interface for the distributed SCA binding that allows me to add so
new methods onto the SCA binding

o.a.t.s.d.core
  A specialisation of the CompositeActivator which extends the build
method. This is possible the most interesting bit as this is where the
decision is made about where components run.

o.a.t.s.d.host
 The distributed domain, runtime and node service runtimes. Based heavily
on the existing domains and runtimes. But the existing implementations are
ties down tightly so I had to pretty much copy the code.

o.a.t.s.d.node
 The node model processing as the component registry implementation


The majority of the work in this exercise was just plumbing the right bits
of information to the right place. Anyhow I have a whole list of issues that
I encountered along the way but I will divulge those in bite sized chunk.

If you build all of the modules then calculator-distributed will test
distributed operation (sort of)  from the mvn command. For the real effect
though use the ant file.

ant runC
ant runB
ant runA

will run the three nodes of the the distributed calculator sample (see
calculator-distributed.png). You do need to be running ActiveMQ 4.1.0  to
make this work (the unit test runs it automatically though).

I'm out until later tomorrow so I'll add it to the trunk build then so it
starts getting tested. As I mentioned above I will start separate threads
about what I have found and what I think we should do next.

Simon

Reply via email to