示例#1
0
        public StitchesModule(CrossStitchCore core, StitchesConfiguration configuration = null)
        {
            _messageBus   = core.MessageBus;
            configuration = configuration ?? StitchesConfiguration.GetDefault();
            var fileSystem = new StitchFileSystem(configuration, new DateTimeVersionManager());
            var manager    = new StitchInstanceManager(configuration, fileSystem);
            var log        = new ModuleLog(_messageBus, Name);
            var observer   = new StitchEventObserver(_messageBus, log);
            var data       = new DataHelperClient(core.MessageBus);
            var notifier   = new StitchEventNotifier(_messageBus);

            _service = new StitchesService(core, data, fileSystem, manager, observer, log, notifier);
        }
示例#2
0
        public StitchesModule(CrossStitchCore core, StitchesConfiguration configuration = null)
        {
            configuration = configuration ?? StitchesConfiguration.GetDefault();
            var log  = new ModuleLog(core.MessageBus, Name);
            var data = new DataHelperClient(core.MessageBus);

            var observer       = new StitchEventObserver(core.MessageBus, data, log);
            var fileSystem     = new StitchFileSystem(configuration, new DateTimeVersionManager());
            var adaptorFactory = new StitchAdaptorFactory(core, configuration, fileSystem, log, observer);
            var manager        = new StitchInstanceManager(fileSystem, adaptorFactory);

            var notifier = new StitchEventNotifier(core.MessageBus);

            _service       = new StitchesService(core, data, fileSystem, manager, log, notifier);
            _subscriptions = new SubscriptionCollection(core.MessageBus);
        }
示例#3
0
        public StitchesService(CrossStitchCore core, IDataRepository data, StitchFileSystem fileSystem, StitchInstanceManager stitchInstanceManager, StitchEventObserver observer, IModuleLog log, IStitchEventNotifier notifier)
        {
            _fileSystem = fileSystem;
            _data       = data;
            _core       = core;
            _notifier   = notifier;
            _log        = log;

            _stitchInstanceManager = stitchInstanceManager;
            _stitchInstanceManager.StitchStateChange       += observer.StitchInstancesOnStitchStateChanged;
            _stitchInstanceManager.HeartbeatReceived       += observer.StitchInstanceManagerOnHeartbeatReceived;
            _stitchInstanceManager.LogsReceived            += observer.StitchInstanceManagerOnLogsReceived;
            _stitchInstanceManager.RequestResponseReceived += observer.StitchInstanceManagerOnRequestResponseReceived;
            _stitchInstanceManager.DataMessageReceived     += observer.StitchInstanceManagerOnDataMessageReceived;
        }