code: public void onChangeMode(IndexerIoMode mode)
     {
        if (mode == IndexerIoMode.READ_WRITE)
        {
           // In READ_WRITE, the value of UpdateInProgress is changed locally so no need to listen
           // to the cache
           cache.removeListener(this);
        }
        else
        {
           // In READ_ONLY, the value of UpdateInProgress will be changed remotely, so we have
           // no need but to listen to the cache to be notified when the value changes
           cache.addListener(this);
        }
     }
docs: {@inheritDoc}