cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Royal <pro...@managingpartners.com>
Subject Re: endless loop in ComponentSelector building Sitemap
Date Mon, 25 Mar 2002 19:54:10 GMT
On Monday 25 March 2002 02:15 pm, volker.schmitt@basf-it-services.com wrote:
> I have written a Poolable Transformer which does a lookup to the Sitemap
> TransformerSelector (in the compose method).
>
> public void compose(ComponentManager manager)
> throws ComponentException
> {
>     this.manager = manager;
>     transformerSelector = (ComponentSelector)
>         manager.lookup(Transformer.ROLE + "Selector");
> }

Don't do the lookup there :) The first time you need the selector set your 
transformerSelector variable. Ala

ComponentSelector getTransformerSelector() 
{
  if (this.transformerSelector == null) {
     this.transformerSelector = (ComponentSelector)
         manager.lookup(Transformer.ROLE + "Selector");
  }

  return this.transformerSelector;
}

-pete

-- 
peter royal -> proyal@managingpartners.com

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message