From: Julio G. <ju...@us...> - 2004-11-09 11:53:08
|
Update of /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/examples/spawn In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15422/smartfrog/src/org/smartfrog/examples/spawn Modified Files: Spawn.java Log Message: Modified to use createNewChild. Index: Spawn.java =================================================================== RCS file: /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/examples/spawn/Spawn.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Spawn.java 15 Mar 2004 19:17:14 -0000 1.2 --- Spawn.java 9 Nov 2004 11:52:59 -0000 1.3 *************** *** 50,54 **** /** The component description to be deployed. */ ! ComponentDescription offspringDescription; /** The generic name prefix used to name the siblings. */ String offspringName = "copy"; --- 50,54 ---- /** The component description to be deployed. */ ! ComponentDescription offspringDescription=null; /** The generic name prefix used to name the siblings. */ String offspringName = "copy"; *************** *** 90,94 **** destination = (Compound) sfResolve (refDestination); } catch (SmartFrogResolutionException rex ){ ! destination = this; } }catch (SmartFrogException sfex) { --- 90,94 ---- destination = (Compound) sfResolve (refDestination); } catch (SmartFrogResolutionException rex ){ ! destination = null; } }catch (SmartFrogException sfex) { *************** *** 102,111 **** for (int i = 0 ; i < familySize ; i ++) { String copyName = offspringName + (new Integer(i)).toString(); ! Prim p = sfDeployComponentDescription( ! copyName, ! destination, ! (ComponentDescription)offspringDescription.copy(), ! null); ! p.sfDeploy(); } } --- 102,116 ---- for (int i = 0 ; i < familySize ; i ++) { String copyName = offspringName + (new Integer(i)).toString(); ! Prim p=null; ! if (destination==null) { ! p = this.sfCreateNewChild(copyName,(ComponentDescription)offspringDescription.copy(),null); ! } else { ! p = sfDeployComponentDescription( ! copyName, ! destination, ! (ComponentDescription)offspringDescription.copy(), ! null); ! p.sfDeploy(); ! } } } |