Infinispan JGROUPS force Change View
<p>I'm working with Wildfly 9.x , with Infinispan 7.2.3. I'm facing up to the problem of forcing a jgroups change_view event in order to elect a different coordinator in a "predestroy" phase.</p>

<p>This snippet code :</p>

<pre><code>Address localAddr=cacheManager.getAddress();
        Address coord=cacheManager.getMembers().get(0);
        if(!localAddr.equals(coord)) {
           logger.error("View can only be changed on coordinator");
            return;
        }
        if(cacheManager.getTransport().getMembers().size() == 1) {
             logger.error("Coordinator cannot change as view only has a single member");
            return;
        }

        long newId= cacheManager.getTransport().getViewId() + 1;
        List&lt;Address&gt; mbrs = cacheManager.getMembers();
        Address tmpCoord=mbrs.remove(0);
</code></pre>

<p>gives me this error:</p>

<pre><code>10:13:28,688 WARN  [org.jboss.as.ee] (ServerService Thread Pool -- 95) WFLYEE0006: Failed to destroy component instance org.jboss.as.ejb3.component.singleton.SingletonComponentInstance@5d8d8b5c: javax.ejb.EJBException: java.lang.UnsupportedOperationException
    at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:187)
    at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:277)
    at org.jboss.as.ejb3.tx.CMTTxInterceptor.requiresNew(CMTTxInterceptor.java:349)
    at org.jboss.as.ejb3.tx.LifecycleCMTTxInterceptor.processInvocation(LifecycleCMTTxInterceptor.java:66)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
    at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
    at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
    at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
    at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)
    at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
    at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
    at org.jboss.as.ee.component.BasicComponentInstance.destroy(BasicComponentInstance.java:125)
    at org.jboss.as.ejb3.component.singleton.SingletonComponent.destroySingletonInstance(SingletonComponent.java:185)
    at org.jboss.as.ejb3.component.singleton.SingletonComponent.done(SingletonComponent.java:142)
    at org.jboss.as.ejb3.component.EJBComponent.stop(EJBComponent.java:559)
    at org.jboss.as.ee.component.ComponentStartService$2.run(ComponentStartService.java:78)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: java.lang.UnsupportedOperationException
    at java.util.Collections$UnmodifiableList.remove(Collections.java:1317)
    at com.klopotek.core.session.job.SessionsHooverScheduler.changeView(SessionsHooverScheduler.java:219)
    at com.klopotek.core.session.job.SessionsHooverScheduler.stopJobs(SessionsHooverScheduler.java:192)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptor.java:96)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
    at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doLifecycleInterception(Jsr299BindingsInterceptor.java:114)
    at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:98)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
    at org.jboss.as.ee.component.ManagedReferenceReleaseInterceptor.processInvocation(ManagedReferenceReleaseInterceptor.java:56)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
    at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
    at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:275)
    ... 24 more
</code></pre>

<p>Is there a way to force the set of a new view using infinispan?</p>