<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 8, 2013 at 2:06 PM, Mircea Markus <span dir="ltr">&lt;<a href="mailto:mmarkus@redhat.com" target="_blank">mmarkus@redhat.com</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>
On 8 May 2013, at 10:40, Pedro Ruivo wrote:<br>
<br>
&gt; On 05/08/2013 10:36 AM, Manik Surtani wrote:<br>
&gt;&gt;<br>
&gt;&gt; On 8 May 2013, at 10:34, Pedro Ruivo &lt;<a href="mailto:pedro@infinispan.org">pedro@infinispan.org</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; Hi guys,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; In order to use the TimeService inside the cache loaders/stores I had to<br>
&gt;&gt;&gt; change the method init() to include a new parameter the TimeService.<br>
&gt;&gt;<br>
&gt;&gt; Won&#39;t this break custom/3rd party impls?<br>
&gt;<br>
&gt; probably/definitely yes.<br>
</div>-1<br>
<div class="im">&gt;<br>
&gt; but I don&#39;t want to create a cache in all the cache loader/store tests<br>
&gt; that will be used to pick the TimeService.<br>
&gt;<br>
&gt; I tried to mock the ComponentRegistry but it is not possible for final<br>
&gt; classes. I don&#39;t want to remove the final :(<br>
&gt;<br>
&gt; Another alternative that come to my mind was to add a new method in<br>
&gt; AdvancedCache that returns the TimeService (and this I can mock it in<br>
&gt; the test suite)<br>
<br>
</div>+1<br>
<br></blockquote></div><br></div><div class="gmail_extra">Couldn&#39;t you change CacheLoaderManager to call ComponentRegistry.wireDependencies(cacheStore)? <br><br>That way, each cache store could have a separate @Inject method, and it could depend on any cache-scoped or global-scoped component. It may require an infinispan-module.properties file in each cache store module, but it then it could be used for any other component.<br>

</div></div>