cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carsten Ziegeler <cziege...@apache.org>
Subject Re: CallFunctionNode problems in trunk
Date Fri, 12 May 2006 13:23:03 GMT
Reinhard Poetz schrieb:
> I'm not sure if I'm on the right track. What I found so far is that if a node is 
> a LinkedProcessingNodeBuilder its linkNode() method is called. When the tree 
> processor is set up, a node builder is registered for this step by adding it to 
> the linkedBuilders collection:
> 
>      public ProcessingNodeBuilder createNodeBuilder
>          (Configuration config) throws Exception {
> 
>          // FIXME : check namespace
>          String nodeName = config.getName();
> 
>          if (getLogger().isDebugEnabled()) {
>              getLogger().debug("Creating node builder for " + nodeName);
>          }
> 
>          ProcessingNodeBuilder builder;
>          try {
>              builder = (ProcessingNodeBuilder) this.itsBuilders.select(nodeName);
>          } catch (ServiceException ce) {
>              // Is it because this element is unknown ?
>              if (this.itsBuilders.isSelectable(nodeName)) {
>                  // No : rethrow
>                  throw ce;
>              }
>              // Throw a more meaningful exception
>              String msg = ...
>              throw new ConfigurationException(msg);
>          }
> 
>          builder.setBuilder(this);
> 
>          if (builder instanceof LinkedProcessingNodeBuilder) {
>              this.linkedBuilders.add(builder);
>          }
> 
>          return builder;
>      }
> 
> 
> IIUC this.itsBuilders.select(...) always returns the same instance of the 
> CallNodeBuilder object. As the CallNodeBuilder has state (node --> a 
> CallFunctionNode object), the linkNode() method always operates on the same object.
> 
Yes, this could be the problem. I briefly looked through the code and
(i'm not sure) it seems that avalon components without a lifecycle
interface (threadsafe or poolable) or not treated as SingleThreaded in
the new Spring based container.
In line 106 in XmlConfigCreator class in cocoon core we should change from
                    } else {
                        current.setModel(ComponentInfo.MODEL_PRIMITIVE);
                    }

to
                    } else {
                        current.setModel(ComponentInfo.MODEL_PRIMITIVE);
                        singleton = false;
                    }

SVN is currently not working, so I can't commit and I have no time to
test :( So if someone else could please do this, would be great.

Carsten
-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

Mime
View raw message