cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathaniel Alfred" <Alfred.Nathan...@swx.com>
Subject RE: Re: [IMP] synchronization on session object in Cocoon
Date Wed, 11 May 2005 16:03:35 GMT
> -----Original Message-----
> From: news [mailto:news@sea.gmane.org]On Behalf Of Joerg Heinicke
> Sent: Mittwoch, 11. Mai 2005 17:22
> To: dev@cocoon.apache.org
> Subject: Re: [IMP] synchronization on session object in Cocoon
 
> I have implemented the session attribute solution. Would be 
> nice if you can
> review it:
> 
> public Session getSession(boolean create) {
>     // we must assure a 1:1-mapping of server session to 
> cocoon session
>     javax.servlet.http.HttpSession serverSession = 
> this.req.getSession(create);
>     if (serverSession != null) {
>         synchronized (serverSession) {
>             // retrieve existing wrapper
>             this.session =
> (HttpSession)serverSession.getAttribute(HTTP_SESSION);
>             if (this.session == null) {
>                 // create wrapper
>                 this.session = new HttpSession(serverSession);
>                 serverSession.setAttribute(HTTP_SESSION, 
> this.session);
>             }
>         }
>     } else {
>         // invalidate
>         this.session = null;
>     }
>     return this.session;
> }

Looks good to me.

Cheers, Alfred.
 
 
This message is for the named person's use only. It may contain confidential, proprietary
or legally privileged information. No confidentiality or privilege is waived or lost by any
mistransmission. If you receive this message in error, please notify the sender urgently and
then immediately delete the message and any copies of it from your system. Please also immediately
destroy any hardcopies of the message. You must not, directly or indirectly, use, disclose,
distribute, print, or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail communications through their
networks. Any views expressed in this message are those of the individual sender, except where
the message states otherwise and the sender is authorised to state them to be the views of
the sender's company.

Mime
View raw message