Esempio n. 1
0
 public DistributedInterceptCache(IOptions <LmsDistributedCacheOptions> distributedCacheOption,
                                  IDistributedCache cache,
                                  ICancellationTokenProvider cancellationTokenProvider,
                                  IDistributedCacheSerializer serializer,
                                  IDistributedCacheKeyNormalizer keyNormalizer)
     : base(distributedCacheOption, cache, cancellationTokenProvider, serializer, keyNormalizer)
 {
 }
 public DistributedCacheInterceptor(
     IDistributedCache cache,
     IDistributedCacheSerializer serializer
     )
 {
     _cache      = cache;
     _serializer = serializer;
 }
Esempio n. 3
0
        public DistributedCache(
            IOptions <CacheOptions> cacheOption,
            IDistributedCache cache,
            IDistributedCacheSerializer serializer)
        {
            _cacheOption = cacheOption.Value;
            Cache        = cache;
            Logger       = NullLogger <DistributedCache <TCacheItem> > .Instance;
            Serializer   = serializer;

            SetDefaultOptions();
        }
Esempio n. 4
0
 public DistributedCache(
     IOptions <AbpDistributedCacheOptions> distributedCacheOption,
     IDistributedCache cache,
     ICancellationTokenProvider cancellationTokenProvider,
     IDistributedCacheSerializer serializer,
     ICurrentTenant currentTenant) : base(
         distributedCacheOption: distributedCacheOption,
         cache: cache,
         cancellationTokenProvider: cancellationTokenProvider,
         serializer: serializer,
         currentTenant: currentTenant)
 {
 }
Esempio n. 5
0
 public DistributedCache(
     IOptions <AbpDistributedCacheOptions> distributedCacheOption,
     IDistributedCache cache,
     ICancellationTokenProvider cancellationTokenProvider,
     IDistributedCacheSerializer serializer,
     IDistributedCacheKeyNormalizer keyNormalizer) : base(
         distributedCacheOption: distributedCacheOption,
         cache: cache,
         cancellationTokenProvider: cancellationTokenProvider,
         serializer: serializer,
         keyNormalizer: keyNormalizer)
 {
 }
        public NullCacheEntryTests()
        {
            // Setup Distributed Cache
            _fakeDistributedCache = A.Fake <IDistributedCache>();

            A.CallTo(() => _fakeDistributedCache.Get(Key)).Returns(null);
            A.CallTo(() => _fakeDistributedCache.GetAsync(Key, default(CancellationToken))).Returns(Task.FromResult <byte[]>(null));

            // Setup Serializer
            _fakeCacheSerializer = A.Fake <IDistributedCacheSerializer>();

            // Setup DistributedResponseCache
            _distributedResponseCache = new DistributedResponseCache(_fakeDistributedCache, _fakeCacheSerializer);
        }
Esempio n. 7
0
        public DistributedCache(
            IOptions <CacheOptions> cacheOption,
            IOptions <DistributedCacheOptions> distributedCacheOption,
            IDistributedCache cache,
            IDistributedCacheSerializer serializer)
        {
            _distributedCacheOption = distributedCacheOption.Value;
            _cacheOption            = cacheOption.Value;
            Cache         = cache;
            Logger        = NullLogger <DistributedCache <TCacheItem> > .Instance;
            Serializer    = serializer;
            SyncSemaphore = new SemaphoreSlim(1, 1);

            SetDefaultOptions();
        }
Esempio n. 8
0
 public DistributedCache(
     IOptions <AbpDistributedCacheOptions> distributedCacheOption,
     IDistributedCache cache,
     ICancellationTokenProvider cancellationTokenProvider,
     IDistributedCacheSerializer serializer,
     IDistributedCacheKeyNormalizer keyNormalizer,
     IHybridServiceScopeFactory serviceScopeFactory) : base(
         distributedCacheOption: distributedCacheOption,
         cache: cache,
         cancellationTokenProvider: cancellationTokenProvider,
         serializer: serializer,
         keyNormalizer: keyNormalizer,
         serviceScopeFactory: serviceScopeFactory)
 {
 }
Esempio n. 9
0
        public OrchestrationTests()
        {
            // Setup Distributed Cache
            _fakeDistributedCache = A.Fake <IDistributedCache>();

            A.CallTo(() => _fakeDistributedCache.Get(Key)).Returns(_serializedValue);
            A.CallTo(() => _fakeDistributedCache.GetAsync(Key, default(CancellationToken))).Returns(_serializedValue);

            // Setup Serializer
            _fakeCacheSerializer = A.Fake <IDistributedCacheSerializer>();
            A.CallTo(() => _fakeCacheSerializer.Serialize(_deserializedValue)).Returns(_serializedValue);
            A.CallTo(() => _fakeCacheSerializer.Deserialize(_serializedValue)).Returns(_deserializedValue);

            // Setup DistributedResponseCache
            _distributedResponseCache = new DistributedResponseCache(_fakeDistributedCache, _fakeCacheSerializer);
        }
Esempio n. 10
0
 public DistributedCache(
     IOptions <AbpDistributedCacheOptions> distributedCacheOption,
     IDistributedCache cache,
     ICancellationTokenProvider cancellationTokenProvider,
     IDistributedCacheSerializer serializer,
     IDistributedCacheKeyNormalizer keyNormalizer,
     IServiceScopeFactory serviceScopeFactory,
     IUnitOfWorkManager unitOfWorkManager) : base(
         distributedCacheOption: distributedCacheOption,
         cache: cache,
         cancellationTokenProvider: cancellationTokenProvider,
         serializer: serializer,
         keyNormalizer: keyNormalizer,
         serviceScopeFactory: serviceScopeFactory,
         unitOfWorkManager: unitOfWorkManager)
 {
 }
Esempio n. 11
0
        public DistributedCache(
            IOptions <CacheOptions> cacheOption,
            IOptions <DistributedCacheOptions> distributedCacheOption,
            IDistributedCache cache,
            ICancellationTokenProvider cancellationTokenProvider,
            IDistributedCacheSerializer serializer,
            ICurrentTenant currentTenant)
        {
            _distributedCacheOption = distributedCacheOption.Value;
            _cacheOption            = cacheOption.Value;
            Cache = cache;
            CancellationTokenProvider = cancellationTokenProvider;
            Logger        = NullLogger <DistributedCache <TCacheItem> > .Instance;
            Serializer    = serializer;
            CurrentTenant = currentTenant;

            SetDefaultOptions();
        }
Esempio n. 12
0
        public DistributedCache(
            IOptions <LmsDistributedCacheOptions> distributedCacheOption,
            IDistributedCache cache,
            ICancellationTokenProvider cancellationTokenProvider,
            IDistributedCacheSerializer serializer,
            IDistributedCacheKeyNormalizer keyNormalizer)
        {
            _distributedCacheOption = distributedCacheOption.Value;
            Cache = cache;
            CancellationTokenProvider = cancellationTokenProvider;
            Logger        = NullLogger <DistributedCache <TCacheItem, TCacheKey> > .Instance;
            Serializer    = serializer;
            KeyNormalizer = keyNormalizer;

            SyncSemaphore = new SemaphoreSlim(1, 1);

            SetDefaultOptions();
        }
Esempio n. 13
0
 public DistributedCache(IDistributedCacheSerializer serializer, IDistributedCache cache) : base(serializer, cache)
 {
 }
 public DistributedCacheQueryBehavior(ILoggerFactory loggerFactory, IDistributedCache distributedCache, IDistributedCacheSerializer distributedCacheSerializer)
     : base(loggerFactory)
 {
     _distributedCache           = distributedCache ?? throw new ArgumentNullException(nameof(distributedCache));
     _distributedCacheSerializer = distributedCacheSerializer ?? throw new ArgumentNullException(nameof(distributedCacheSerializer));
 }
 public DistributedResponseCache(IDistributedCache distributedCache, IDistributedCacheSerializer serializer)
 {
     _distributedCache = distributedCache;
     _serializer       = serializer;
 }