/** * Initialization through constructor. * * @param store * target store to retrieve features * @param cache * cache manager to limit overhead of store */ public FF4jCacheProxy(FeatureStore fStore, PropertyStore pStore, FF4JCacheManager cache) { this.cacheManager = cache; this.targetFeatureStore = fStore; this.targetPropertyStore = pStore; this.store2CachePoller = new Store2CachePollingScheduler(fStore, pStore, cache); }
/** * Start polling with a polling */ public void start(long delay) { this.pollingDelay = delay; start(); }
/** * Stop the polling of target store is required. */ public void stopPolling() { if (store2CachePoller == null) { throw new IllegalStateException("The poller has not been initialize, please check"); } getStore2CachePoller().stop(); }
/** * Start the polling of target store is required. */ public void startPolling(long delay) { if (store2CachePoller == null) { throw new IllegalStateException("The poller has not been initialize, please check"); } getStore2CachePoller().start(delay); }