public static void switchCache ( ) throws InterruptedException { //swith between two cache if ( cacheReference == masterCache ) { cacheReference = slaveCache ; masterCache . clear ( ) ; } else { cacheReference = masterCache ; slaveCache . clear ( ) ; } }
Switch online and standby cache