/** * Resets the event q by first destroying the existing one and starting up new one. * <p> * There may be no good reason to kill the existing queue. We will sometimes need to set a new * listener id, so we should create a new queue. We should let the old queue drain. If we were * Connected to the failover, it would be best to finish sending items. */ public void resetEventQ() { ICacheEventQueue<K, V> previousQueue = cacheEventQueue; this.cacheEventQueue = createCacheEventQueue(this.remoteCacheClient); if ( previousQueue.isWorking() ) { // we don't expect anything, it would have all gone to the zombie if ( log.isInfoEnabled() ) { log.info( "resetEventQ, previous queue has [" + previousQueue.size() + "] items queued up." ); } previousQueue.destroy(); } }
/** * Resets the event q by first destroying the existing one and starting up new one. * <p> * There may be no good reason to kill the existing queue. We will sometimes need to set a new * listener id, so we should create a new queue. We should let the old queue drain. If we were * Connected to the failover, it would be best to finish sending items. */ public void resetEventQ() { ICacheEventQueue<K, V> previousQueue = cacheEventQueue; CacheEventQueueFactory<K, V> fact = new CacheEventQueueFactory<K, V>(); this.cacheEventQueue = fact.createCacheEventQueue( new CacheAdaptor<K, V>( remoteCacheClient ), remoteCacheClient .getListenerId(), remoteCacheClient.getCacheName(), remoteCacheClient.getAuxiliaryCacheAttributes() .getEventQueuePoolName(), remoteCacheClient.getAuxiliaryCacheAttributes().getEventQueueType() ); if ( previousQueue.isWorking() ) { // we don't expect anything, it would have all gone to the zombie if ( log.isInfoEnabled() ) { log.info( "resetEventQ, previous queue has [" + previousQueue.size() + "] items queued up." ); } previousQueue.destroy(); } }