I created a new method call startPeers() .. it recursively starts all peers (so peers of peers too).
The only rule you have to follow as a Service devloper is 

  • have a addPeer("myService","ServiceType") in getMetaData 
  • have a member transient ServiceType myService;

And it will auto-magically get created, started and assigned when Service.startPeers() is called.  This potentially replaces a lot of inconsistent code in the composite services.

Initially I put this in Service.startService() - so when a service started, it would start all the peers.  But after trying to start InMoov from the gui - it seemed a bit too much.  All of a sudden I had a bajillion services.

The function currently exists, but I commented it out in Service.startService.

releasePeers() - I created a while ago, and it has been terrific for releasing all the extra services which get created when testing.

What needs to happen :

  • startPeers needs to be put into the Service Life-Cycle somewhere - http://myrobotlab.org/content/service-life-cycle
  • Perhaps the UI needs to change to "create service instead of start service" ? and a manual start button somewhere ? (not sure about this ...)