/// <summary>
        /// Конструктор.
        /// </summary>
        /// <param name="keyspace">Пространство имен для ключей.</param>
        /// <param name="connectionFactory">Фабрика подключений к Redis.</param>
        /// <param name="log">Сервис регистрации событий.</param>
        /// <param name="performanceLog">Сервис регистрации длительности выполнения методов.</param>
        public RedisMessageBusPublisher(string keyspace, RedisConnectionFactory connectionFactory, ILog log, IPerformanceLog performanceLog)
        {
            _keyspace          = keyspace;
            _connectionFactory = connectionFactory;

            _log            = log;
            _performanceLog = performanceLog;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Конструктор.
        /// </summary>
        /// <param name="keyspace">Пространство имен для ключей.</param>
        /// <param name="connectionFactory">Фабрика подключений к Redis.</param>
        /// <param name="log">Сервис регистрации событий.</param>
        /// <param name="performanceLog">Сервис регистрации длительности выполнения методов.</param>
        public RedisCacheImpl(string keyspace, RedisConnectionFactory connectionFactory, ILog log, IPerformanceLog performanceLog)
        {
            _keyspace          = keyspace;
            _connectionFactory = connectionFactory;

            _log            = log;
            _performanceLog = performanceLog;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Конструктор.
        /// </summary>
        /// <param name="keyspace">Пространство имен для ключей.</param>
        /// <param name="connectionFactory">Фабрика подключений к Redis.</param>
        /// <param name="log">Сервис регистрации событий.</param>
        /// <param name="performanceLog">Сервис регистрации длительности выполнения методов.</param>
        public RedisMessageBusManager(string keyspace, RedisConnectionFactory connectionFactory, ILog log, IPerformanceLog performanceLog)
        {
            _keyspace           = keyspace;
            _connectionFactory  = connectionFactory;
            _messageBusObserver = new Lazy <RedisMessageBusObserver>(CreateMessageBusObserver);

            _log            = log;
            _performanceLog = performanceLog;
        }
 public FileSystemBlobStorage(FileSystemBlobStorageSettings settings,
                              IObjectSerializer objectSerializer,
                              IMimeTypeResolver mimeTypeResolver,
                              IPerformanceLog performanceLog)
 {
     _baseDirectory    = settings.BaseDirectory;
     _mimeTypeResolver = mimeTypeResolver;
     _objectSerializer = objectSerializer;
     _performanceLog   = performanceLog;
 }
Exemplo n.º 5
0
        public HttpServiceNancyModuleInitializer(IMimeTypeResolver mimeTypeResolver,
                                                 IUserIdentityProvider userIdentityProvider,
                                                 IJsonObjectSerializer jsonObjectSerializer,
                                                 HttpRequestExcutorFactory httpRequestExcutorFactory,
                                                 IEnumerable <IHttpGlobalHandler> httpGlobalHandlers,
                                                 IEnumerable <IHttpServiceSource> httpServiceSources,
                                                 IPerformanceLog performanceLog)
        {
            _mimeTypeResolver          = mimeTypeResolver;
            _userIdentityProvider      = userIdentityProvider;
            _jsonObjectSerializer      = jsonObjectSerializer;
            _httpRequestExcutorFactory = httpRequestExcutorFactory;
            _httpGlobalHandlers        = httpGlobalHandlers;
            _httpServices   = new Lazy <IEnumerable <IHttpService> >(() => httpServiceSources.SelectMany(i => i.GetServices()).ToArray());
            _performanceLog = performanceLog;

            _nancyHttpServices = new Lazy <Dictionary <Type, NancyHttpService> >(CreateNancyHttpServices);
        }
Exemplo n.º 6
0
        public DocumentHttpService(IDocumentHttpServiceHandlerBase serviceHandler,
                                   IDocumentQueryFactory <TDocument> queryFactory,
                                   IDocumentStorageFactory storageFactory,
                                   ISystemDocumentStorageFactory systemStorageFactory,
                                   IBlobStorage blobStorage,
                                   IPerformanceLog performanceLog,
                                   ILog log)
            : base(performanceLog, log)
        {
            var storage = serviceHandler.AsSystem
                ? systemStorageFactory.GetStorage <TDocument>(serviceHandler.DocumentType)
                : storageFactory.GetStorage <TDocument>(serviceHandler.DocumentType);

            DocumentType = storage.DocumentType;
            CanGet       = serviceHandler.CanGet;
            CanPost      = serviceHandler.CanPost;
            CanDelete    = serviceHandler.CanDelete;

            _serviceHandler = (IDocumentHttpServiceHandler <TDocument>)serviceHandler;
            _queryFactory   = queryFactory;
            _blobStorage    = blobStorage;
            _storage        = storage;
        }
Exemplo n.º 7
0
 protected DocumentHttpServiceBase(IPerformanceLog performanceLog, ILog log)
 {
     _performanceLog = performanceLog;
     _log            = log;
 }
Exemplo n.º 8
0
 public BlobHttpService(IBlobStorage blobStorage, IPerformanceLog performanceLog, ILog log)
 {
     _blobStorage    = blobStorage;
     _performanceLog = performanceLog;
     _log            = log;
 }
Exemplo n.º 9
0
 /// <summary>
 /// Фиксирует в логе информацию о длительности работы указанного метода, используя <c>DateTime.Now</c> в качестве момента окончания выполнения метода.
 /// </summary>
 /// <param name="method">Метод компонента, длительность вызова которого была замерена.</param>
 /// <param name="start">Момент начала выполнения метода.</param>
 /// <param name="outcome">Результат выполнения: <c>null</c> - если вызов метода завершился успешно; <c>текст исключения</c> - иначе.</param>
 public static void Log(this IPerformanceLog target, string method, DateTime start, Exception outcome)
 {
     target.Log(method, start, GetFullMessage(outcome));
 }
Exemplo n.º 10
0
 /// <summary>
 /// Фиксирует в логе информацию о длительности вызова указанного метода.
 /// </summary>
 /// <param name="method">Метод компонента, длительность вызова которого была замерена.</param>
 /// <param name="duration">Длительность выполнения метода.</param>
 /// <param name="outcome">Результат выполнения: <c>null</c> - если вызов метода завершился успешно; <c>текст исключения</c> - иначе.</param>
 public static void Log(this IPerformanceLog target, string method, TimeSpan duration, Exception outcome)
 {
     target.Log(method, duration, GetFullMessage(outcome));
 }
Exemplo n.º 11
0
 public ErrorHandlingOwinMiddleware(OwinMiddleware next, ILog log, IPerformanceLog performanceLog) : base(next)
 {
     _log            = log;
     _performanceLog = performanceLog;
 }