public InProcSessionManager(InProcSessionsConfiguration configuration, IInProcSessionCache sessionCache, IInProcSessionFactory sessionFactory, IPeriodicCacheCleaner periodicCacheCleaner) { if (configuration == null) { throw new ArgumentNullException("configuration"); } if (sessionCache == null) { throw new ArgumentNullException("sessionCache"); } if (sessionFactory == null) { throw new ArgumentNullException("sessionFactory"); } if (periodicCacheCleaner == null) { throw new ArgumentNullException("periodicCacheCleaner"); } _configuration = configuration; _sessionCache = sessionCache; _sessionFactory = sessionFactory; _periodicCacheCleaner = periodicCacheCleaner; // Start periodic cleaning _periodicCacheCleaner.Start(); }
public PeriodicCacheCleaner(InProcSessionsConfiguration configuration, IInProcSessionCache sessionCache, IPeriodicTaskFactory periodicTaskFactory, ICancellationTokenSourceFactory cancellationTokenSourceFactory) { if (configuration == null) throw new ArgumentNullException("configuration"); if (sessionCache == null) throw new ArgumentNullException("sessionCache"); if (periodicTaskFactory == null) throw new ArgumentNullException("periodicTaskFactory"); if (cancellationTokenSourceFactory == null) throw new ArgumentNullException("cancellationTokenSourceFactory"); _configuration = configuration; _cancellationTokenSourceFactory = cancellationTokenSourceFactory; _periodicTask = periodicTaskFactory.Create(sessionCache.Trim); }
public InProcSessionManagerFixture() { _nancyContext = new NancyContext(); _fakeSessionIdentificationMethod = A.Fake<IInProcSessionIdentificationMethod>(); _validConfiguration = new InProcSessionsConfiguration {SessionIdentificationMethod = _fakeSessionIdentificationMethod, SessionTimeout = TimeSpan.FromMinutes(30), CacheTrimInterval = TimeSpan.FromMinutes(40)}; _fakeSessionCache = A.Fake<IInProcSessionCache>(); _fakeSessionFactory = A.Fake<IInProcSessionFactory>(); _fakePeriodicCacheCleaner = A.Fake<IPeriodicCacheCleaner>(); _sessionManager = new InProcSessionManager(_validConfiguration, _fakeSessionCache, _fakeSessionFactory, _fakePeriodicCacheCleaner); }
public InProcSessionManagerFixture() { _nancyContext = new NancyContext(); _fakeSessionIdentificationMethod = A.Fake <IInProcSessionIdentificationMethod>(); _validConfiguration = new InProcSessionsConfiguration { SessionIdentificationMethod = _fakeSessionIdentificationMethod, SessionTimeout = TimeSpan.FromMinutes(30), CacheTrimInterval = TimeSpan.FromMinutes(40) }; _fakeSessionCache = A.Fake <IInProcSessionCache>(); _fakeSessionFactory = A.Fake <IInProcSessionFactory>(); _fakePeriodicCacheCleaner = A.Fake <IPeriodicCacheCleaner>(); _sessionManager = new InProcSessionManager(_validConfiguration, _fakeSessionCache, _fakeSessionFactory, _fakePeriodicCacheCleaner); }
public PeriodicCacheCleanerFixture() { _fakeSessionCache = A.Fake<IInProcSessionCache>(); _fakePeriodicTaskFactory = A.Fake<IPeriodicTaskFactory>(); _fakePeriodicTask = A.Fake<IPeriodicTask>(); _fakeCancellationTokenSourceFactory = A.Fake<ICancellationTokenSourceFactory>(); _validConfiguration = new InProcSessionsConfiguration(); _cancellationTokenSource = new CancellationTokenSource(); A.CallTo(() => _fakeCancellationTokenSourceFactory.Create()).Returns(_cancellationTokenSource); A.CallTo(() => _fakePeriodicTaskFactory.Create(A<Action>._)).Returns(_fakePeriodicTask); _periodicCacheCleaner = new PeriodicCacheCleaner(_validConfiguration, _fakeSessionCache, _fakePeriodicTaskFactory, _fakeCancellationTokenSourceFactory); }
public InProcSessionManager(InProcSessionsConfiguration configuration, IInProcSessionCache sessionCache, IInProcSessionFactory sessionFactory, IPeriodicCacheCleaner periodicCacheCleaner) { if (configuration == null) throw new ArgumentNullException("configuration"); if (sessionCache == null) throw new ArgumentNullException("sessionCache"); if (sessionFactory == null) throw new ArgumentNullException("sessionFactory"); if (periodicCacheCleaner == null) throw new ArgumentNullException("periodicCacheCleaner"); _configuration = configuration; _sessionCache = sessionCache; _sessionFactory = sessionFactory; _periodicCacheCleaner = periodicCacheCleaner; // Start periodic cleaning _periodicCacheCleaner.Start(); }
public PeriodicCacheCleanerFixture() { _fakeSessionCache = A.Fake <IInProcSessionCache>(); _fakePeriodicTaskFactory = A.Fake <IPeriodicTaskFactory>(); _fakePeriodicTask = A.Fake <IPeriodicTask>(); _fakeCancellationTokenSourceFactory = A.Fake <ICancellationTokenSourceFactory>(); _validConfiguration = new InProcSessionsConfiguration(); _cancellationTokenSource = new CancellationTokenSource(); A.CallTo(() => _fakeCancellationTokenSourceFactory.Create()).Returns(_cancellationTokenSource); A.CallTo(() => _fakePeriodicTaskFactory.Create(A <Action> ._)).Returns(_fakePeriodicTask); _periodicCacheCleaner = new PeriodicCacheCleaner(_validConfiguration, _fakeSessionCache, _fakePeriodicTaskFactory, _fakeCancellationTokenSourceFactory); }
public PeriodicCacheCleaner(InProcSessionsConfiguration configuration, IInProcSessionCache sessionCache, IPeriodicTaskFactory periodicTaskFactory, ICancellationTokenSourceFactory cancellationTokenSourceFactory) { if (configuration == null) { throw new ArgumentNullException("configuration"); } if (sessionCache == null) { throw new ArgumentNullException("sessionCache"); } if (periodicTaskFactory == null) { throw new ArgumentNullException("periodicTaskFactory"); } if (cancellationTokenSourceFactory == null) { throw new ArgumentNullException("cancellationTokenSourceFactory"); } _configuration = configuration; _cancellationTokenSourceFactory = cancellationTokenSourceFactory; _periodicTask = periodicTaskFactory.Create(sessionCache.Trim); }