velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mailmur <mail...@yahoo.com>
Subject Re: Multiple Velocity Engines?
Date Wed, 02 May 2007 16:43:02 GMT
Probably he should make own singleton wrapper and
instantiate VelocityEngine per use. Don't have example
available atm, but creating own VelocityEngine
instance was just to give constructor Properties
instance and its done. This allows different
.properties settings for each engine instance.

public class MyVMEngines {
  private static engine1, engine2;

  public static synchronized VE getEngine1() {
   ...code here...
   return engine1;
  }

  public static synchronized VE getEngine2() {
   ...code here...
   return engine2;
  }
}

--- Lee van der Veen <lvanderv@gmail.com> wrote:
> I believe having multiple singletons would involve
> having multiple  
> class loaders.  You may want to look in that
> direction if you really  
> need singletons.
> 
> Lee
> 
> On 1-May-07, at 3:59 PM, White, Tim wrote:
> 
> > Is there a way to initialize several velocity
> engines?  i.e. multiple singletons?
> >
> > Tim


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Mime
View raw message