Dynamic Object Groups

Dynamic object groups provide a powerful, easy-to-use mechansim for writing master-slave programs where the number of slaves may vary from during execution.  This allows dynamic object groups to easily make use of transitory nodes such as screen-saver and browser based nodes where users donate CPU time.

Dynamic Object Groups generally work as follows:

A user runs the master object from the command prompt.  The master object then creates a dynamic object group.  As nodes are added to the system, the slave object specified is created on them.  When a slave is created, init() is called to allow the slave to initialize itself.  When the system wants the slave to run it calls start() on the slave.  The slave will usually have a loop in start() which will call request() on the master and then perform work on the work returned by the master.  When the system desires the slave to stop working it will call stop() on the slave.  Before the slave is terminated by the system, destroy() is called to allow the slave to do any final cleaning up.

Note that, by design, the life-cycle of slaves closely resembles the life-cycle of applets.

Also note that masters run in the same virtual machine as the system prompt they are launched from.

To compile a dynamic object group application simply use makeAll or makeOne.  (See Basic Tasks.)

See the dynamic object group example for more information:
SimpleMaster.java
SimpleSlave.java