[...]
So I added a new method to "cocoon" that sets up an object just as if it were an Avalon component by honoring the various lifecycle interfaces.
[...]
Example: var foo = new Foo(); cocoon.setupObject(foo); foo.doIt("blah");
This looks quite interesting and definitely useful. But I've got a question:
When I obtain a component in a flowscript, I have to release it before sendPage(). So, if my foo object uses components, does it have to release them before a sendPage() occurs in a script?
class Foo implements Serviceable { public void service(ServiceManager manager) { myComponent = (MyComponent) manager.lookup(MyComponent.ROLE); } ... }
cocoon.summonObject(Packages.bar.Foo.class.getName()); foo.doIt("blah"); foo.releaseComponents(); cocoon.sendPageAndWait(...);
Is this correct?
Thank you in advance, -- Andreas