예제 #1
0
 internal static IFlagCacheManager CreateFlagCacheManager(Configuration configuration,
                                                          ISimplePersistance persister,
                                                          IFlagListenerUpdater updater,
                                                          User user)
 {
     if (configuration.FlagCacheManager != null)
     {
         return(configuration.FlagCacheManager);
     }
     else
     {
         var inMemoryCache = new UserFlagInMemoryCache();
         var deviceCache   = new UserFlagDeviceCache(persister);
         return(new FlagCacheManager(inMemoryCache, deviceCache, updater, user));
     }
 }
예제 #2
0
 internal static IFlagCacheManager CreateFlagCacheManager(Configuration configuration,
                                                          IPersistentStorage persister,
                                                          IFlagChangedEventManager flagChangedEventManager,
                                                          User user)
 {
     if (configuration._flagCacheManager != null)
     {
         return(configuration._flagCacheManager);
     }
     else
     {
         var inMemoryCache = new UserFlagInMemoryCache();
         var deviceCache   = configuration.PersistFlagValues ? new UserFlagDeviceCache(persister) as IUserFlagCache : new NullUserFlagCache();
         return(new FlagCacheManager(inMemoryCache, deviceCache, flagChangedEventManager, user));
     }
 }