You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Carsten Ziegeler <cz...@apache.org> on 2006/07/03 15:48:04 UTC

[2.2] Setting up Cocoon and reloading

Daniel and I changed the way how Cocoon is setup in 2.2 in the last
week. Instead of doing everything in a single servlet, we now setup a
Cocoon Spring BeanFactory in a servlet listener. This bean factory is
stored as an attribute in the servlet context and can be retrieved by
any servlet component.
In addition we have a simple servlet now, which gets the container from
the attribute, gets the root tree processor from the container and
starts processing the request.
This is a very simple setup that should give us more flexibility in the
future.

The new approach provides all features the old CocoonServlet had with
one exception: reloading of the core. In Cocoon 2.1.x you can reload the
core by providing the "?cocoon-reload=true" parameter and if reloading
is turned on, the whole Cocoon instance is reloaded.

Now, the question is if we still need this feature. I started to add a
servlet filter for just reloading but then ran into some problems: for
reloading we need to setup a new bean factory and disregard the old
instance. First this has the same problem as we have with 2.1.x. What
happens if older requests are still processed? - We can neglect this as
this is a development only feature anyway.
But more interesting is, what happens with all the servlets, listeners
and filters out there who have a reference to the old container? We
could solve this by a facade if we want.
And another problem: this will setup a new cocoon instance, but a
possible root Spring context is not reloaded anyway.

So, due to all these problems I would suggest that we simply forget
about this feature. This can be handled by reloading the whole webapp
context through the application server which then really reloads
everything and takes care of old processes (in one way or the other).

Please note that this of course does not affect sitemap reloading which
still works without any problems.

WDYT?

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

Re: [2.2] Setting up Cocoon and reloading

Posted by Simone Gianni <s....@thebug.it>.
+1 for forgetting about it. Containers should provide a way to reload a
context, not servlets inside it. Also while developing with jetty the
advantage of having this feature compared to a complete jetty restart is
just a few seconds.

Anyway this will somehow probably return on 3.0 where the osgi core
bundle can be activated and deactivated, right Daniel?

Simone

Carsten Ziegeler wrote:

>Daniel and I changed the way how Cocoon is setup in 2.2 in the last
>week. Instead of doing everything in a single servlet, we now setup a
>Cocoon Spring BeanFactory in a servlet listener. This bean factory is
>stored as an attribute in the servlet context and can be retrieved by
>any servlet component.
>In addition we have a simple servlet now, which gets the container from
>the attribute, gets the root tree processor from the container and
>starts processing the request.
>This is a very simple setup that should give us more flexibility in the
>future.
>
>The new approach provides all features the old CocoonServlet had with
>one exception: reloading of the core. In Cocoon 2.1.x you can reload the
>core by providing the "?cocoon-reload=true" parameter and if reloading
>is turned on, the whole Cocoon instance is reloaded.
>
>Now, the question is if we still need this feature. I started to add a
>servlet filter for just reloading but then ran into some problems: for
>reloading we need to setup a new bean factory and disregard the old
>instance. First this has the same problem as we have with 2.1.x. What
>happens if older requests are still processed? - We can neglect this as
>this is a development only feature anyway.
>But more interesting is, what happens with all the servlets, listeners
>and filters out there who have a reference to the old container? We
>could solve this by a facade if we want.
>And another problem: this will setup a new cocoon instance, but a
>possible root Spring context is not reloaded anyway.
>
>So, due to all these problems I would suggest that we simply forget
>about this feature. This can be handled by reloading the whole webapp
>context through the application server which then really reloads
>everything and takes care of old processes (in one way or the other).
>
>Please note that this of course does not affect sitemap reloading which
>still works without any problems.
>
>WDYT?
>
>Carsten
>  
>
-- 
Simone Gianni

Re: [2.2] Setting up Cocoon and reloading

Posted by Bertrand Delacretaz <bd...@apache.org>.
On 7/3/06, Carsten Ziegeler <cz...@apache.org> wrote:

> ...Instead of doing everything in a single servlet, we now setup a
> Cocoon Spring BeanFactory in a servlet listener. This bean factory is
> stored as an attribute in the servlet context and can be retrieved by
> any servlet component...

Simple and effective, cool!

> ...So, due to all these problems I would suggest that we simply forget
> about this feature...

+1, never used it anyway.

-Bertrand