public CacheApiBean(PropertyStore propertyStore) { if (propertyStore instanceof FF4jCacheProxy) { FF4jCacheProxy cacheProxy = (FF4jCacheProxy) propertyStore; // FIXME : This is wrong. Need to ask Cedrick to change the implementation for property cacheStore = cacheProxy.getCachedTargetStore(); cacheProvider = cacheProxy.getCacheProvider(); propertyNames = cacheProxy.getCacheManager().listCachedPropertyNames(); } }
public CacheApiBean(FeatureStore featureStore) { if (featureStore instanceof FF4jCacheProxy) { FF4jCacheProxy cacheProxy = (FF4jCacheProxy) featureStore; cacheStore = cacheProxy.getCachedTargetStore(); cacheProvider = cacheProxy.getCacheProvider(); featureNames = cacheProxy.getCacheManager().listCachedFeatureNames(); } }
/** {@inheritDoc} */ @Override public Object getPropertyNativeCache() { return getPropertyCache(); }
/** {@inheritDoc} */ @Override public void delete(String featureId) { // Access target store getTargetFeatureStore().delete(featureId); // even is not present, evict won't failed getCacheManager().evictFeature(featureId); }
/** {@inheritDoc} */ @Override public boolean existProperty(String propertyName) { // not in cache but maybe created from last access if (getCacheManager().getProperty(propertyName) == null) { return getTargetPropertyStore().existProperty(propertyName); } return true; }
/** {@inheritDoc} */ @Override public void deleteProperty(String name) { // Access target store getTargetPropertyStore().deleteProperty(name); // even is not present, evict name failed getCacheManager().evictProperty(name); }
/** {@inheritDoc} */ public String getCacheProvider() { if (cacheManager != null) { return cacheManager.getCacheProviderName(); } else { return null; } }
/** * Initialisation of internal caches. */ public FF4jJCacheManager(String providerClassName) { this.cachingProvider = initCachingProvider(providerClassName); initCaches(); }
/** * Parameterized constructor. * * @param fcp * cache proxy */ public Store2CachePollingWorker(FF4jCacheProxy fcp) { this(fcp.getTargetFeatureStore(),fcp.getTargetPropertyStore(),null); this.ff4JCacheProxy = fcp; }
/** * 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); }
/** * Default Constructor. */ public FeatureStoreJCache(String cachingProviderClassName) { this(new FF4jJCacheManager(cachingProviderClassName)); }
/** {@inheritDoc} */ @Override public Object getFeatureNativeCache() { return getCacheFeatures(); }
/** {@inheritDoc} */ @Override public Object getFeatureNativeCache() { return getFeaturesCache(); }
/** {@inheritDoc} */ @Override public Object getPropertyNativeCache() { return getPropertiesCache(); }
/** * Getter accessor for attribute 'featuresCache'. * * @return * current value of 'featuresCache' */ public Cache<String, Feature> getFeaturesCache() { if (featuresCache == null) { initCaches(); } return featuresCache; }
/** {@inheritDoc} */ @Override public Object getFeatureNativeCache() { return getFeaturesCache(); }
/** * Start polling with a polling */ public void start(long delay) { this.pollingDelay = delay; start(); }
/** * Constructor from its feature store. * * @param featureStore * cuurent fature store */ public CacheApiBean(FeatureStore featureStore) { if (featureStore instanceof FF4jCacheProxy) { FF4jCacheProxy cacheProxy = (FF4jCacheProxy) featureStore; cacheStore = cacheProxy.getCachedTargetStore(); cacheProvider = cacheProxy.getCacheProvider(); featureNames = cacheProxy.getCacheManager().listCachedFeatureNames(); } }
/** * Constructor from its feature store. * * @param featureStore * cuurent fature store */ public CacheApiBean(PropertyStore featureStore) { if (featureStore instanceof FF4jCacheProxy) { FF4jCacheProxy cacheProxy = (FF4jCacheProxy) featureStore; cacheStore = cacheProxy.getCachedTargetStore(); cacheProvider = cacheProxy.getCacheProvider(); propertyNames = cacheProxy.getCacheManager().listCachedPropertyNames(); } }
/** * Default Constructor. */ public PropertyStoreJCache(String cachingProviderClassName) { this(new FF4jJCacheManager(cachingProviderClassName)); }