Re: creating child compound component
Steve Loughran <[email protected]> Fri, 16 Mar 2007 14:02:24 +0000
| Newsgroups | gmane.comp.java.smartfrog.devel |
|---|---|
| Message-ID | <[email protected]> |
Goldsack, Patrick wrote: > > There are a number of issues here: > > 1) As a Compound IS a Prim, you can use the sfCreateNewChild method for > compounds as well. It takes a ComopnentDescription hierarchy which > deploys to whatever it defines, runs it through the lifecycle, and adds > it to the parent as a child. > > 2) sfAddChild is used to add an already deployed component as a child > (and is used by sfCreateNewChild). > > 3) If you just want to create the component tree, but not run any of the > other lifecycle methods, use the sfDeployComponentDescritpion method on > Compound to do this. This is also used by the sfCreateNewChild to build > the tree before it runs the lifecycle methods. If > sfDeployComponentDescritpion is given a parent, it uses sfAddChild to > add the created component tree to the parent after creation. > > Patrick Can I add that the org.smartfrog.sfcore.workflow.eventbus.EventCompoundImpl class has lots of support for partially deploying a child, deploying and starting children, and handling their failures. Its a good place to start if you are trying to do things, especially as there are lots of override points for handling child termination. At the very least, look at the code. -steve ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV