cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: Pipeline components and Object Model issues
Date Fri, 17 Aug 2007 03:32:12 GMT
On 14.08.2007 12:26 Uhr, Grzegorz Kossakowski wrote:

> The problem is that Object Model is a signleton object (more precisely, 
> with "call" scope defined in cocoon-servlet-service-impl)

So the problem is not with internal pipelines at all since they are 
scoped anyway? Or does this apply only for servlet service? Do other 
internal protocol still exist at all?

> To elaborate on it further, the situation is similar to the situation 
> when thread-unsafe component is used in two threads at the same time.

This comparison does not really apply. You don't get corrupted state but 
some last-wins situation in case of conflicts. If two components in a 
pipeline have the same parameter the last one added wins. So the result 
is actually predictable - but unwanted of course.

> I proposed[5] to create new Spring scope (or reuse sitemap scope that
> must be implemented).  Actually, such scope does, behind-the-scene, what I described
one
> paragraph above. It creates new instance (that may inherit properties
> from old one) of Object Model when entering pipeline components.

I wonder if that "scope" makes much sense. It's a 1:1-relationship to 
the component anyway. What we need is only a wrapper that delegates 
read-only access to parent object model in case the child could not 
serve the requested value. Maybe we just talk about the same ...

Actually this whole problem reminds me of session attributes in portlet 
environment. A portlet's session attributes work exactly like written 
above - but all are stored within the global HTTP session though by 
prefixing the session attribute names with a portlet-unique string. And 
I wonder how fast we will observe another requirement: "I know that I 
might break something but I WANT make this attribute globally 
available." This concept is known in portlet session attributes. You can 
enforce writing an attribute straight to the global session. See the 
corresponding methods on PortletSession [1] (actually they call it 
"scope" as well).

How is the object model injected into such a sitemap component? Still 
via setup()?

Joerg

[1] http://www.bluesunrise.com/portlet-api/javax/portlet/PortletSession.html

Mime
View raw message