[ 
https://issues.apache.org/jira/browse/DELTASPIKE-1277?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16066638#comment-16066638
 ] 

Alexander Falb commented on DELTASPIKE-1277:
--------------------------------------------

The problem I am trying to solve is mostly regarded to unit tests. When testing 
a service that uses _Resolvers_ with caching enabled it's not possible to load 
a new value if one is already cached.

Another idea to forcefully reload cached values would be some sort of global 
eviction. I had some {{ConfigResolverUtils.refreshValue("key")}} in mind. From 
a usage point of view I would prefer this to the solution provided by the 
patch, because there would be no need the get hold of the actual resolver. But 
on the other hand all resolvers then have to register to some global 
registration point. That also sounded not that "fun" to implement, so I finally 
decided to propose a minimally invasive and simple solution, to get some early 
feedback. But if you are interested I could work on the other idea too.

> Force refresh of cached config values
> -------------------------------------
>
>                 Key: DELTASPIKE-1277
>                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-1277
>             Project: DeltaSpike
>          Issue Type: Improvement
>          Components: Configuration
>            Reporter: Alexander Falb
>         Attachments: forcerefresh.patch
>
>
> When using a {{TypedResolver}} or {{UntypedResolver}} with caching enabled, 
> there is no way of bypassing the cache and forcefully reloading the value 
> from underlying datasources.
> The attached patch is a proposal of creating such an mechanism. It introduces 
> a {{void forceRefresh()}} method to the {{TypedResolver}}, implements this 
> method by resetting the {{reloadAfter}} field and adds a unit test.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to