/** * Gets the stats attribute of the RemoteCacheManager object * <p> * @return The stats value */ public String getStats() { StringBuilder stats = new StringBuilder(); for (RemoteCacheNoWait<?, ?> c : caches.values()) { if ( c != null ) { stats.append( c.getCacheName() ); } } return stats.toString(); }
/** * Gets the stats attribute of the RemoteCacheManager object * <p> * @return The stats value */ public String getStats() { StringBuilder stats = new StringBuilder(); for (RemoteCacheNoWait<?, ?> c : caches.values()) { if ( c != null ) { stats.append( c.getCacheName() ); } } return stats.toString(); }
private void removeListenerFromCache(RemoteCacheNoWait<?, ?> cache) throws IOException { IRemoteCacheClient<?, ?> rc = cache.getRemoteCache(); if ( log.isDebugEnabled() ) { log.debug( "Found cache for [" + cache.getCacheName() + "], deregistering listener." ); } // could also store the listener for a server in the manager. IRemoteCacheListener<?, ?> listener = rc.getListener(); remoteWatch.removeCacheListener( cache.getCacheName(), listener ); }
/** Shutdown all. */ public void release() { // Wait until called by the last client if ( --clients != 0 ) { return; } synchronized ( caches ) { for (RemoteCacheNoWait<?, ?> c : caches.values()) { if ( c != null ) { try { // c.dispose(); freeCache( c.getCacheName() ); } catch ( IOException ex ) { log.error( "Problem in release.", ex ); } } } } }
/** Shutdown all. */ public void release() { cacheLock.lock(); try { for (RemoteCacheNoWait<?, ?> c : caches.values()) { try { if ( log.isInfoEnabled() ) { log.info( "freeCache [" + c.getCacheName() + "]" ); } removeListenerFromCache(c); c.dispose(); } catch ( IOException ex ) { log.error( "Problem releasing " + c.getCacheName(), ex ); } } caches.clear(); } finally { cacheLock.unlock(); } }