Rafal Krzewski wrote:
> 
> Hello.
> 
> There was a discussion about running multiple instances of Velocity
> Runtime
> in a single VM. I needed that functionality for my Turbine-like
> framework.
> (Turbine's deprecation policy makes it virtually impossible to integrate
> the things I developed with Turbine 2.2 in mind with any future version
> of Turbine)
> 
> There is a patch enclosed that adds this capability, it  was made
> against
> current CVS sources.
> 
> It is fully backward compatible for applications that intialize Velocity
> through app.Velocity facade class. After calling any of Velocity.init()
> methods, the application may call static methods of both Velocity and
> Runtime classes and everything will work as expeceted.
> If an aplication wishes to use multiple Velocity engines concurrently,
> it should create an instance of Runtime, initialize it using the
> non-static
> methods (addProperty/setProperty/clearProperty/init or init(path) or
> init(properties))
> and keep the reference to the created object.
> Then, it should use Runtime.useRuntime() method to select an apropriate
> engine
> for use. All subsequent calls to the static methods of the Runtime class
> from
> the thread that called useRuntime() will be handled by the selected
> Runtime instance.
> Discarding all references to a Runtime instance makes it (and all it's
> assets including
> cached templates) eligible to garbage collection.
> 
> That's all. I've tested this and it works fine for me.
> 
> Many thanks to Jason,Geir and the rest of the band for making a great
> product!
> 

Cool!

Rafal did you run it against the testbed? I'm just trying out the patch
and I'm getting some failures from the testbed.

Reply via email to