<br><br><div class="gmail_quote">On Wed, May 2, 2012 at 12:07 AM, Brent Putman <span dir="ltr">&lt;<a href="mailto:putmanb@georgetown.edu" target="_blank">putmanb@georgetown.edu</a>&gt;</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>
&gt; Hi,<br>
&gt;<br>
&gt; After doing some research, I found that there is a way to use multiple<br>
&gt; instances of Velocity. It&#39;s actually pretty simple. It is explained<br>
&gt; 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>
&gt;<br>
&gt;<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&#39;t ever use<br>
what they call there the &quot;singleton model&quot;.  So to be honest, I&#39;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: &quot;Velocity.init();&quot;. 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&#39;m not sure what you mean with you last phrase, but that&#39;s probably because I&#39;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&#39;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 &quot;separate instance model&quot;.  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&#39; 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>
&gt;<br>
&gt; Unfortunately overriding initializeVelocity doesn&#39;t work since it is a<br>
&gt; static method, so the only option seems to be to override bootstrap()<br>
&gt; and leave out the initializeVelocity() method. Sadly, this also means<br>
&gt; that the static String[] xmlToolingsConfigs must be copied.<br>
<br>
<br>
</div>Yeah, you&#39;re right.  Java static methods can&#39;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&#39;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>