cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Dumon <br...@outerthought.org>
Subject RE: How to use input modules in flow
Date Thu, 14 Aug 2003 11:59:55 GMT
On Thu, 2003-08-14 at 12:37, Reinhard Pötz wrote:
> From: news [mailto:news@sea.gmane.org]
> 
> > Reinhard Pötz wrote:
> > 
> > >>The FOM does not provide access to input modules, does it? 
> > So, what is 
> > >>the recommended way to get an object from an Avalon component?
> > > 
> > > var myComp = cocoon.getComponent("myComp.ROLE");
> > > var myObj  = myComp.mymethod();
> > 
> > Thanks for your fast answer!
> > 
> > I guess the component is automatically released when the 
> > script terminates?
> 
> 
> Sorry, forget this. Auto-release hasn't been implemented yet or more
> precicly Chris wrote some experimental stuff but it hasn't been
> integrated into CVS. Maybe we can add this to the scratchpad? What do
> you think Chris? 
> Because of a lack of time I only had a brief look at it but couldn't
> test it more extensivly.
> 
> So back to your question - for now you have to call 
> 
> cocoon.releaseComponent( myComp );

yep, and don't forget to use a try-finally, something like this:

var myObj;
var myComp = cocoon.getComponent(Packages.myComp.ROLE);
try {
   myObj  = myComp.mymethod();
} finally {
   cocoon.releaseComponent( myComp );
}

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


Mime
View raw message