velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geir Magnusson Jr <g...@4quarters.com>
Subject Re: Synchronizing a Context
Date Thu, 15 Jan 2004 13:55:30 GMT

On Jan 15, 2004, at 8:38 AM, Niall Gallagher wrote:

> Hi,
>
> I am relatively new to Velocity and I have been trying to write a 
> shared Context for a group of Servlets. However, I see in the Javadoc 
> documentation that the VelocityContext object is not thread safe, I 
> have also examined the hierarchy of super classes and find that it 
> pretty much comes down to the InternalContextBase.icachePut and 
> InternalContextBase.icacheGet methods.

yes, but see below

>
> What I was wondering was, if I synchronized these methods in a 
> subclass and extended the AbstractContext would I have a thread safe 
> Context implementation ? If not is there any support within the core 
> Velocity API for thread safe (preferably chained) Context objects. Any 
> help on this would be appreciated!

You should be able to do it by chaining - because if I understand what 
you want, you want to share data between threads.  I think that will 
work - I'll have to go stare at things again, but I'd look into that 
first before doing anything fancy.

geir

>
> Niall
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
-- 
Geir Magnusson Jr                                   203-247-1713(m)
geir@4quarters.com


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message