/** * Returns the asyn cache status. An error status indicates either the lateral connection is not * available, or the asyn queue has been unexpectedly destroyed. No lateral invocation. * <p> * @return The status value */ @Override public CacheStatus getStatus() { return eventQueue.isWorking() ? cache.getStatus() : CacheStatus.ERROR; }
/** * Returns the asyn cache status. An error status indicates either the lateral connection is not * available, or the asyn queue has been unexpectedly destroyed. No lateral invocation. * <p> * @return The status value */ @Override public CacheStatus getStatus() { return eventQueue.isWorking() ? cache.getStatus() : CacheStatus.ERROR; }
/** * Constructs with the given lateral cache, and fires up an event queue for asynchronous * processing. * <p> * @param cache */ public LateralCacheNoWait( LateralCache<K, V> cache ) { this.cache = cache; if ( log.isDebugEnabled() ) { log.debug( "Constructing LateralCacheNoWait, LateralCache = [" + cache + "]" ); } CacheEventQueueFactory<K, V> fact = new CacheEventQueueFactory<K, V>(); this.eventQueue = fact.createCacheEventQueue( new CacheAdaptor<K, V>( cache ), CacheInfo.listenerId, cache .getCacheName(), cache.getAuxiliaryCacheAttributes().getEventQueuePoolName(), cache .getAuxiliaryCacheAttributes().getEventQueueType() ); // need each no wait to handle each of its real updates and removes, // since there may // be more than one per cache? alternative is to have the cache // perform updates using a different method that specifies the listener // this.q = new CacheEventQueue(new CacheAdaptor(this), // LateralCacheInfo.listenerId, cache.getCacheName()); if ( cache.getStatus() == CacheStatus.ERROR ) { eventQueue.destroy(); } }
/** * Constructs with the given lateral cache, and fires up an event queue for asynchronous * processing. * <p> * @param cache */ public LateralCacheNoWait( LateralCache<K, V> cache ) { this.cache = cache; if ( log.isDebugEnabled() ) { log.debug( "Constructing LateralCacheNoWait, LateralCache = [" + cache + "]" ); } CacheEventQueueFactory<K, V> fact = new CacheEventQueueFactory<K, V>(); this.eventQueue = fact.createCacheEventQueue( new CacheAdaptor<K, V>( cache ), CacheInfo.listenerId, cache .getCacheName(), cache.getAuxiliaryCacheAttributes().getEventQueuePoolName(), cache .getAuxiliaryCacheAttributes().getEventQueueType() ); // need each no wait to handle each of its real updates and removes, // since there may // be more than one per cache? alternative is to have the cache // perform updates using a different method that specifies the listener // this.q = new CacheEventQueue(new CacheAdaptor(this), // LateralCacheInfo.listenerId, cache.getCacheName()); if ( cache.getStatus() == CacheStatus.ERROR ) { eventQueue.destroy(); } }