code: protected void activeStatusChanged(final boolean newActiveState)
     {
        // originally came from EXOJCR-1345. 
        // Deadlock occurs inside JGroups, if calling some operations inside the same thread,
        // invoking ViewChanged. That's why, need to perform operation in separated async tread.
        new Thread(new Runnable()
        {
           public void run()
           {
              coordinator = newActiveState;
  
              getModeHandler().setMode(coordinator ? IndexerIoMode.READ_WRITE : IndexerIoMode.READ_ONLY);
              LOG.info("Set indexer io mode to:" + (coordinator ? IndexerIoMode.READ_WRITE : IndexerIoMode.READ_ONLY));
  
              if (coordinator)
              {
                 doPushState();
              }
           }
        }, "JCR Indexer ActiveStatusChanged-handler").start();
     }
docs: Method called when the cache either becomes the coordinator or stops being the coordinator. If it becomes the
  coordinator, it can optionally start the in-memory state transfer to the underlying cache store.
  
  @param newActiveState true if the cache just became the coordinator, false if the cache stopped being the
  coordinator.