/** * Calls localRemoveAll on the CompositeCache. * <p> * @param cacheName * @throws IOException */ @Override public void handleRemoveAll( String cacheName ) throws IOException { if ( log.isDebugEnabled() ) { log.debug( "handleRemoveAll> cacheName=" + cacheName ); } getCacheManager().<K, V>getCache( cacheName ).localRemoveAll(); }
/** * Calls localRemove on the CompositeCache. * <p> * @param cacheName * @param key * @throws IOException */ @Override public void handleRemove( String cacheName, K key ) throws IOException { if ( log.isDebugEnabled() ) { log.debug( "handleRemove> cacheName=" + cacheName + ", key=" + key ); } getCacheManager().<K, V>getCache( cacheName ).localRemove( key ); }
/** * Calls localRemoveAll on the CompositeCache. * <p> * @param cacheName * @throws IOException */ @Override public void handleRemoveAll( String cacheName ) throws IOException { if ( log.isDebugEnabled() ) { log.debug( "handleRemoveAll> cacheName=" + cacheName ); } CompositeCache<K, V> cache = getCacheManager().getCache( cacheName ); cache.localRemoveAll(); }
/** * Calls localRemove on the CompositeCache. * <p> * @param cacheName * @param key * @throws IOException */ @Override public void handleRemove( String cacheName, K key ) throws IOException { removes++; if ( log.isDebugEnabled() ) { if ( removes % 100 == 0 ) { log.debug( "removes = " + removes ); } log.debug( "handleRemove> cacheName=" + cacheName + ", key=" + key ); } CompositeCache<K, V> cache = getCacheManager().getCache( cacheName ); cache.localRemove( key ); }
/** * Gets the set of keys of objects currently in the cache. * <p> * @param cacheName * @return Set */ public Set<K> processGetKeySet( String cacheName ) { CompositeCache<K, V> cache = getCacheManager().getCache( cacheName ); return cache.getKeySet(); }
/** * Gets the set of keys of objects currently in the cache. * <p> * @param cacheName * @return Set */ public Set<K> processGetKeySet( String cacheName ) { CompositeCache<K, V> cache = getCacheManager().getCache( cacheName ); return cache.getKeySet(); }
/** * Processes a shutdown request. * <p> * @param cacheName * @param requesterId * @throws IOException */ @Override public void processDispose( String cacheName, long requesterId ) throws IOException { CompositeCache<K, V> cache = getCacheManager().getCache( cacheName ); cache.dispose(); }
/** * Processes a shutdown request. * <p> * @param cacheName * @param requesterId * @throws IOException */ @Override public void processDispose( String cacheName, long requesterId ) throws IOException { CompositeCache<K, V> cache = getCacheManager().getCache( cacheName ); cache.dispose(); }
/** * Gets the cacheManager attribute of the LateralCacheTCPListener object. * <p> * Normally this is set by the factory. If it wasn't set the listener defaults to the expected * singleton behavior of the cache manager. * <p> * @param name * @return CompositeCache */ protected CompositeCache<K, V> getCache( String name ) { if ( getCacheManager() == null ) { // revert to singleton on failure try { setCacheManager( CompositeCacheManager.getInstance() ); } catch (CacheException e) { throw new RuntimeException("Could not retrieve cache manager instance", e); } if ( log.isDebugEnabled() ) { log.debug( "cacheMgr = " + getCacheManager() ); } } return getCacheManager().getCache( name ); }
/** * Processes a get request. * <p> * If isAllowClusterGet is enabled we will treat this as a normal request or non-remote origins. * <p> * @param cacheName * @param key * @param requesterId * @return ICacheElement * @throws IOException */ @Override public ICacheElement<K, V> processGet( String cacheName, K key, long requesterId ) throws IOException { CompositeCache<K, V> cache = getCacheManager().getCache( cacheName ); boolean keepLocal = !remoteHttpCacheServerAttributes.isAllowClusterGet(); if ( keepLocal ) { return cache.localGet( key ); } else { return cache.get( key ); } }
/** * Processes a get request. * <p> * If isAllowClusterGet is enabled we will treat this as a normal request of non-remote * origination. * <p> * @param cacheName * @param pattern * @param requesterId * @return Map * @throws IOException */ @Override public Map<K, ICacheElement<K, V>> processGetMatching( String cacheName, String pattern, long requesterId ) throws IOException { CompositeCache<K, V> cache = getCacheManager().getCache( cacheName ); boolean keepLocal = !remoteHttpCacheServerAttributes.isAllowClusterGet(); if ( keepLocal ) { return cache.localGetMatching( pattern ); } else { return cache.getMatching( pattern ); } }
/** * Processes a removeAll request. * <p> * If isLocalClusterConsistency is enabled we will treat this as a normal request of non-remote * origination. * <p> * @param cacheName * @param requesterId * @throws IOException */ @Override public void processRemoveAll( String cacheName, long requesterId ) throws IOException { CompositeCache<K, V> cache = getCacheManager().getCache( cacheName ); boolean keepLocal = !remoteHttpCacheServerAttributes.isLocalClusterConsistency(); if ( keepLocal ) { cache.localRemoveAll(); } else { cache.removeAll(); } }
/** * Processes a remove request. * <p> * If isLocalClusterConsistency is enabled we will treat this as a normal request of non-remote * origination. * <p> * @param cacheName * @param key * @param requesterId * @throws IOException */ @Override public void processRemove( String cacheName, K key, long requesterId ) throws IOException { CompositeCache<K, V> cache = getCacheManager().getCache( cacheName ); boolean keepLocal = !remoteHttpCacheServerAttributes.isLocalClusterConsistency(); if ( keepLocal ) { cache.localRemove( key ); } else { cache.remove( key ); } }
/** * Processes a removeAll request. * <p> * If isLocalClusterConsistency is enabled we will treat this as a normal request of non-remote * origination. * <p> * @param cacheName * @param requesterId * @throws IOException */ @Override public void processRemoveAll( String cacheName, long requesterId ) throws IOException { CompositeCache<K, V> cache = getCacheManager().getCache( cacheName ); boolean keepLocal = !remoteHttpCacheServerAttributes.isLocalClusterConsistency(); if ( keepLocal ) { cache.localRemoveAll(); } else { cache.removeAll(); } }
/** * Processes a get request. * <p> * If isAllowClusterGet is enabled we will treat this as a normal request or non-remote origins. * <p> * @param cacheName * @param key * @param requesterId * @return ICacheElement * @throws IOException */ @Override public ICacheElement<K, V> processGet( String cacheName, K key, long requesterId ) throws IOException { CompositeCache<K, V> cache = getCacheManager().getCache( cacheName ); boolean keepLocal = !remoteHttpCacheServerAttributes.isAllowClusterGet(); if ( keepLocal ) { return cache.localGet( key ); } else { return cache.get( key ); } }
/** * Processes a remove request. * <p> * If isLocalClusterConsistency is enabled we will treat this as a normal request of non-remote * origination. * <p> * @param cacheName * @param key * @param requesterId * @throws IOException */ @Override public void processRemove( String cacheName, K key, long requesterId ) throws IOException { CompositeCache<K, V> cache = getCacheManager().getCache( cacheName ); boolean keepLocal = !remoteHttpCacheServerAttributes.isLocalClusterConsistency(); if ( keepLocal ) { cache.localRemove( key ); } else { cache.remove( key ); } }
/** * Processes a get request. * <p> * If isAllowClusterGet is enabled we will treat this as a normal request of non-remote * origination. * <p> * @param cacheName * @param keys * @param requesterId * @return Map * @throws IOException */ @Override public Map<K, ICacheElement<K, V>> processGetMultiple( String cacheName, Set<K> keys, long requesterId ) throws IOException { CompositeCache<K, V> cache = getCacheManager().getCache( cacheName ); boolean keepLocal = !remoteHttpCacheServerAttributes.isAllowClusterGet(); if ( keepLocal ) { return cache.localGetMultiple( keys ); } else { return cache.getMultiple( keys ); } }
/** * Processes a get request. * <p> * If isAllowClusterGet is enabled we will treat this as a normal request of non-remote * origination. * <p> * @param cacheName * @param pattern * @param requesterId * @return Map * @throws IOException */ @Override public Map<K, ICacheElement<K, V>> processGetMatching( String cacheName, String pattern, long requesterId ) throws IOException { CompositeCache<K, V> cache = getCacheManager().getCache( cacheName ); boolean keepLocal = !remoteHttpCacheServerAttributes.isAllowClusterGet(); if ( keepLocal ) { return cache.localGetMatching( pattern ); } else { return cache.getMatching( pattern ); } }
/** * Processes an update request. * <p> * If isLocalClusterConsistency is enabled we will treat this as a normal request of non-remote * origination. * <p> * @param item * @param requesterId * @throws IOException */ @Override public void processUpdate( ICacheElement<K, V> item, long requesterId ) throws IOException { CompositeCache<K, V> cache = getCacheManager().getCache( item.getCacheName() ); boolean keepLocal = !remoteHttpCacheServerAttributes.isLocalClusterConsistency(); if ( keepLocal ) { cache.localUpdate( item ); } else { cache.update( item ); } }
/** * Processes an update request. * <p> * If isLocalClusterConsistency is enabled we will treat this as a normal request of non-remote * origination. * <p> * @param item * @param requesterId * @throws IOException */ @Override public void processUpdate( ICacheElement<K, V> item, long requesterId ) throws IOException { CompositeCache<K, V> cache = getCacheManager().getCache( item.getCacheName() ); boolean keepLocal = !remoteHttpCacheServerAttributes.isLocalClusterConsistency(); if ( keepLocal ) { cache.localUpdate( item ); } else { cache.update( item ); } }