<br><br><div class="gmail_quote">On Wed, May 2, 2012 at 12:07 AM, Brent Putman <span dir="ltr"><<a href="mailto:putmanb@georgetown.edu" target="_blank">putmanb@georgetown.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
<br>
On 5/1/12 3:21 PM, Tom van den Berge wrote:<br>
> Hi,<br>
><br>
> After doing some research, I found that there is a way to use multiple<br>
> instances of Velocity. It's actually pretty simple. It is explained<br>
> here: <a href="http://velocity.apache.org/engine/releases/velocity-1.7/developer-guide.html#separate" target="_blank">http://velocity.apache.org/engine/releases/velocity-1.7/developer-guide.html#separate</a><br>
><br>
><br>
<br>
<br>
<br>
</div>You know, we actually already use injected instances of VelocityEngine<br>
on the things that use Velocity templates. We actually don't ever use<br>
what they call there the "singleton model". So to be honest, I'm not<br>
actually sure why we are doing the global Velocity static init like<br>
that. </blockquote><div><br></div><div>You are using the singleton model in DefaultBootstrap: "Velocity.init();". Maybe you are using the separate instances model when you are using velocity templates, but not when initializing.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It might be that newly created VelocityEngine instances just<br>
inherit the properties from the global Velocity singleton if they are<br>
otherwise unspecified, so maybe that is the (not very good) reason. If<br>
that is the case, we can probably just get rid of the Velocity singleton<br>
init entirely, and just make sure to move those properties into the<br>
Velocity Engine instance that is used in the encoders by, for example,<br>
the Shibboleth IdP.<br></blockquote><div> </div><div>I'm not sure what you mean with you last phrase, but that's probably because I'm not very familiar with OpenSAML. I would say if OpenSAML needs Velocity, it needs to take care of its own initialization, and obviously not break any application or library that is using OpenSAML. </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I'll do some more research to confirm. If accurate, I believe we might<br>
be able to do that in a patch release, as it involves no interface<br>
additions or changes.<br></blockquote><div><br></div><div>That would be great! </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Of course, not to point out the obvious, but I believe your app could<br>
also do the same thing, and avoid being stepped on by the current<br>
behavior of OpenSAML, by using the "separate instance model". As a<br>
short-term workaround.<br></blockquote><div><br></div><div>That would definitely be an option. However, I already chose to overwrite DefaultBoostrap, and leave out the velocity initialization, since I dont' need it.</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
<br>
<br>
><br>
> Unfortunately overriding initializeVelocity doesn't work since it is a<br>
> static method, so the only option seems to be to override bootstrap()<br>
> and leave out the initializeVelocity() method. Sadly, this also means<br>
> that the static String[] xmlToolingsConfigs must be copied.<br>
<br>
<br>
</div>Yeah, you're right. Java static methods can't be overridden. I<br>
probably knew this at one point and just forgot. ;-) I thought we were<br>
doing this in a test bootstrap for our unit tests, but turns out it's<br>
not really inheritance we were doing. I was misremembering.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
--<br>
To unsubscribe from this list send an email to <a href="mailto:dev-unsubscribe@shibboleth.net">dev-unsubscribe@shibboleth.net</a><br>
</div></div></blockquote></div><br>