cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: Application Scope variable
Date Tue, 10 Oct 2006 20:55:01 GMT
On 10.10.2006 22:02, Sumedh Shirodkar wrote:

> We are using cocoon to interact with documentum. Documentum creates a 
> session manager that handles all future documentum sessions. If a 
> session is already alive, it can pass that on...if
> 
> Now, we need a way to keep this session manager somewhere so that it can 
> be accessed by any class in the cocoon web-application.
> 
> how should I go about it? where should this session manager variable be 
> stored?

This heavily depends on the scope of the variable. It will be easy if 
your understanding of application scope matches one of the standard 
servlet scopes: request, session and application. If I understand you 
correctly there is one Documentum session (or session manager?) for the 
whole life time of the Cocoon servlet. So a servlet context attribute 
seems to be the most appropriate. If it is also one Documentum session 
per webapp session the session attribute seems to be the best.

But both servlet context and session are not simply available in any 
class in the webapp. You must retrieve them, e.g. via Cocoon's object 
model. Your classes must therefore implement Contextualizable if they 
are not sitemap components.

Another solution would be to use a RequestListener and a ThreadLocal in 
a static field of a helper class, which could be accessed from "anywhere".

Jörg

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


Mime
View raw message