/** * 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(); }
/** * Configures the attributes and the event logger and constructs a service. * <p> * @param cacheManager * @return RemoteHttpCacheService */ protected <K, V> RemoteHttpCacheService<K, V> createRemoteHttpCacheService( ICompositeCacheManager cacheManager ) { Properties props = cacheManager.getConfigurationProperties(); ICacheEventLogger cacheEventLogger = configureCacheEventLogger( props ); RemoteHttpCacheServerAttributes attributes = configureRemoteHttpCacheServerAttributes( props ); RemoteHttpCacheService<K, V> service = new RemoteHttpCacheService<K, V>( cacheManager, attributes, cacheEventLogger ); if ( log.isInfoEnabled() ) { log.info( "Created new RemoteHttpCacheService " + service ); } return service; }
/** * Gets the stats attribute of the RemoteCacheServer object. * <p> * @return The stats value * @throws IOException */ public String getStats() throws IOException { return cacheManager.getStats(); }
/** * Constructs an instance to with the given remote connection parameters. If the connection * cannot be made, "zombie" services will be temporarily used until a successful re-connection * is made by the monitoring daemon. * <p> * @param cacheMgr * @param cacheEventLogger * @param elementSerializer */ private RemoteHttpCacheManager( ICompositeCacheManager cacheMgr, ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer ) { this.cacheMgr = cacheMgr; this.cacheEventLogger = cacheEventLogger; this.elementSerializer = elementSerializer; // register shutdown observer this.cacheMgr.registerShutdownObserver( this ); }
AuxiliaryCache<?, ?> ic = cacheManager.getAuxiliaryCache(factoryName, cacheName);
cacheMgr.registerShutdownObserver( (IShutdownObserver) listener );
AuxiliaryCache<?, ?> ic = cacheManager.getAuxiliaryCache(factoryName, cacheName);
/** * 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 ); }
cacheMgr.registerShutdownObserver( (IShutdownObserver) listener );
/** * Configures the attributes and the event logger and constructs a service. * <p> * @param cacheManager * @return RemoteHttpCacheService */ public static <K extends Serializable, V extends Serializable> RemoteHttpCacheService<K, V> createRemoteHttpCacheService( ICompositeCacheManager cacheManager ) { Properties props = cacheManager.getConfigurationProperties(); ICacheEventLogger cacheEventLogger = configureCacheEventLogger( props ); RemoteHttpCacheServerAttributes attributes = configureRemoteHttpCacheServerAttributes( props ); RemoteHttpCacheService<K, V> service = new RemoteHttpCacheService<K, V>( cacheManager, attributes, cacheEventLogger ); if ( log.isInfoEnabled() ) { log.info( "Created new RemoteHttpCacheService " + service ); } return service; }
AuxiliaryCache<?, ?> ic = cacheManager.getAuxiliaryCache(factoryName, cacheName);
/** * Gets the stats attribute of the RemoteCacheServer object. * <p> * @return The stats value * @throws IOException */ public String getStats() throws IOException { return cacheManager.getStats(); }
/** * 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(); }
cacheMgr.registerShutdownObserver( service );
/** * Registers the driver and creates a poolAccess class. * <p> * @param cattr * @param compositeCacheManager * @return JDBCDiskCachePoolAccess for testing * @throws SQLException if a database access error occurs */ protected JDBCDiskCachePoolAccess initializePoolAccess( JDBCDiskCacheAttributes cattr, ICompositeCacheManager compositeCacheManager ) throws SQLException { JDBCDiskCachePoolAccess poolAccess1 = null; if ( cattr.getConnectionPoolName() != null ) { JDBCDiskCachePoolAccessManager manager = JDBCDiskCachePoolAccessManager.getInstance(); poolAccess1 = manager.getJDBCDiskCachePoolAccess( cattr.getConnectionPoolName(), compositeCacheManager.getConfigurationProperties() ); } else { poolAccess1 = JDBCDiskCachePoolAccessManager.createPoolAccess( cattr ); } return poolAccess1; }
AuxiliaryCache<?, ?> ic = cacheManager.getAuxiliaryCache(factoryName, cacheName);
/** * 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(); }
cacheMgr.registerShutdownObserver( service );
/** * This factory method should create an instance of the jdbc cache. * <p> * @param rawAttr specific cache configuration attributes * @param compositeCacheManager the global cache manager * @param cacheEventLogger a specific logger for cache events * @param elementSerializer a serializer for cache elements * @return JDBCDiskCache the cache instance * @throws SQLException if the cache instance could not be created */ @Override public <K, V> JDBCDiskCache<K, V> createCache( AuxiliaryCacheAttributes rawAttr, ICompositeCacheManager compositeCacheManager, ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer ) throws SQLException { JDBCDiskCacheAttributes cattr = (JDBCDiskCacheAttributes) rawAttr; TableState tableState = getTableState( cattr.getTableName() ); DataSourceFactory dsFactory = getDataSourceFactory(cattr, compositeCacheManager.getConfigurationProperties()); JDBCDiskCache<K, V> cache = new JDBCDiskCache<K, V>( cattr, dsFactory, tableState, compositeCacheManager ); cache.setCacheEventLogger( cacheEventLogger ); cache.setElementSerializer( elementSerializer ); // create a shrinker if we need it. createShrinkerWhenNeeded( cattr, cache ); return cache; }
/** * 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 ); }