<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"><<a href="mailto:mmarkus@redhat.com" target="_blank">mmarkus@redhat.com</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>
On 8 May 2013, at 10:40, Pedro Ruivo wrote:<br>
<br>
> On 05/08/2013 10:36 AM, Manik Surtani wrote:<br>
>><br>
>> On 8 May 2013, at 10:34, Pedro Ruivo <<a href="mailto:pedro@infinispan.org">pedro@infinispan.org</a>> wrote:<br>
>><br>
>>> Hi guys,<br>
>>><br>
>>> In order to use the TimeService inside the cache loaders/stores I had to<br>
>>> change the method init() to include a new parameter the TimeService.<br>
>><br>
>> Won't this break custom/3rd party impls?<br>
><br>
> probably/definitely yes.<br>
</div>-1<br>
<div class="im">><br>
> but I don't want to create a cache in all the cache loader/store tests<br>
> that will be used to pick the TimeService.<br>
><br>
> I tried to mock the ComponentRegistry but it is not possible for final<br>
> classes. I don't want to remove the final :(<br>
><br>
> Another alternative that come to my mind was to add a new method in<br>
> AdvancedCache that returns the TimeService (and this I can mock it in<br>
> the test suite)<br>
<br>
</div>+1<br>
<br></blockquote></div><br></div><div class="gmail_extra">Couldn'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>