You won't be able to fish for the old cache like this. Once it is disrupted with a ForceDisconnectException the old cache won't be returned by CacheFactory.getAnyInstance(). You'll need to retain a reference to the old cache in the test and use that instead.

Client caches shouldn't need to be rebuilt.

Le 7/11/2016 à 11:16 AM, Swapnil Bawaskar a écrit :
private void updateServerCacheAfterReconnect() {
>     new ArrayList<>(Arrays.asList(vm0/*, vm1, vm2*/)).
>       forEach((VM) -> VM.invoke(new SerializableCallable() {
>         @Override
>         public Object call() throws Exception {
>           Cache cache = CacheFactory.getAnyInstance();
>           cache = cache.getReconnectedCache();
>           return null;
>         }
>       }));
>   }
>

Reply via email to