示例#1
0
        public static void RegisterInMemoryModule(this IBusFactoryConfigurator configurator, IServiceProvider provider)
        {
            configurator.RegisterScopedConsumer <BackEnd.CommandHandlers.CreateReactionCommandHandler>(provider, null, c => c.UseCqrsLite());

            configurator.RegisterConsumer <Persistence.EventHandlers.NodesEventHandlers>(provider);
            configurator.RegisterConsumer <Persistence.EventHandlers.RecordsEventHandlers>(provider);

            configurator.RegisterStateMachine <ReactionFileProcessingStateMachine, ReactionFileProcessingState>(provider);
            configurator.RegisterStateMachine <ReactionProcessingStateMachine, ReactionProcessingState>(provider);
        }
示例#2
0
        public static void RegisterInMemoryModule(this IBusFactoryConfigurator bus, IServiceProvider provider)
        {
            bus.RegisterScopedConsumer <BackEnd.CommandHandlers.CreateSubstanceCommandHandler>(provider, null, c => c.UseCqrsLite());

            bus.RegisterConsumer <Persistence.EventHandlers.NodesEventHandlers>(provider);
            bus.RegisterConsumer <Persistence.EventHandlers.RecordsEventHandlers>(provider);

            bus.RegisterStateMachine <ChemicalFileProcessingStateMachine, ChemicalFileProcessingState>(provider);
            bus.RegisterStateMachine <InvalidSubstanceProcessingStateMachine, InvalidSubstanceProcessingState>(provider);
            bus.RegisterStateMachine <SubstanceProcessingStateMachine, SubstanceProcessingState>(provider);
        }
示例#3
0
        public static void RegisterInMemoryModule(this IBusFactoryConfigurator configurator, IServiceProvider provider)
        {
            //  register frontend consumers
            configurator.RegisterScopedConsumer <FrontEnd.CommandHandlers.FilesCommandHandler>(provider, null, c => c.UseCqrsLite());
            configurator.RegisterScopedConsumer <FrontEnd.CommandHandlers.FoldersCommandHandler>(provider, null, c => c.UseCqrsLite());
            configurator.RegisterScopedConsumer <FrontEnd.CommandHandlers.UsersCommandHandler>(provider, null, c => c.UseCqrsLite());

            //  register backend consumers...
            configurator.RegisterScopedConsumer <BackEnd.CommandHandlers.Files.AddImageCommandHandler>(provider, null, c => c.UseCqrsLite());
            configurator.RegisterScopedConsumer <BackEnd.CommandHandlers.Files.UpdateMetadataCommandHandler>(provider, null, c => c.UseCqrsLite());
            configurator.RegisterScopedConsumer <BackEnd.CommandHandlers.Files.ChangeStatusCommandHandler>(provider, null, c => c.UseCqrsLite());
            configurator.RegisterScopedConsumer <BackEnd.CommandHandlers.Files.GrantAccessCommandHandler>(provider, null, c => c.UseCqrsLite());
            configurator.RegisterScopedConsumer <BackEnd.CommandHandlers.Folders.GrantAccessCommandHandler>(provider, null, c => c.UseCqrsLite());
            configurator.RegisterScopedConsumer <BackEnd.CommandHandlers.UserNotifications.DeleteUserNotificationCommandHandler>(provider, null, c => c.UseCqrsLite());

            configurator.RegisterScopedConsumer <BackEnd.EventHandlers.Nodes.FilesEventHandlers>(provider, null, c => c.UseCqrsLite());
            configurator.RegisterScopedConsumer <BackEnd.EventHandlers.Nodes.FoldersEventHandlers>(provider, null, c => c.UseCqrsLite());
            configurator.RegisterScopedConsumer <BackEnd.EventHandlers.BlobEventHandlers>(provider, null, c => c.UseCqrsLite());

            //  register persistence consumers...
            configurator.RegisterConsumer <Persistence.EventHandlers.Files.FileEventHandlers>(provider);
            configurator.RegisterConsumer <Persistence.EventHandlers.Folders.FolderEventHandlers>(provider);
            configurator.RegisterConsumer <Persistence.EventHandlers.Nodes.FileEventHandlers>(provider);
            configurator.RegisterConsumer <Persistence.EventHandlers.Nodes.FolderContentEventHandlers>(provider);
            configurator.RegisterConsumer <Persistence.EventHandlers.Nodes.UserEventHandlers>(provider);
            configurator.RegisterConsumer <Persistence.EventHandlers.Users.UserEventHandlers>(provider);
            configurator.RegisterConsumer <Persistence.EventHandlers.UserNotifications.UserNotificationEventHandler>(provider);

            //  register state machines...
            configurator.RegisterStateMachine <GenericFileProcessingStateMachine, GenericFileProcessingState>(provider);
        }
示例#4
0
        public static void RegisterInMemoryModule(this IBusFactoryConfigurator configurator, IServiceProvider provider)
        {
            configurator.RegisterConsumer <Persistence.EventHandlers.NodesEventHandlers>(provider);
            configurator.RegisterConsumer <Persistence.EventHandlers.FilesEventHandlers>(provider);

            //  register state machines...
            configurator.RegisterStateMachine <MicroscopyFileProcessingStateMachine, MicroscopyFileProcessingState>(provider);
        }
示例#5
0
        public static void RegisterInMemoryModule(this IBusFactoryConfigurator configurator, IServiceProvider provider)
        {
            configurator.RegisterScopedConsumer <BackEnd.CommandHandlers.AddMetadataCommandHandler>(provider, null, c => c.UseCqrsLite());
            configurator.RegisterScopedConsumer <BackEnd.CommandHandlers.UpdatePdfCommandHandler>(provider, null, c => c.UseCqrsLite());

            configurator.RegisterConsumer <Persistence.EventHandlers.NodesEventHandlers>(provider);
            configurator.RegisterConsumer <Persistence.EventHandlers.FilesEventHandlers>(provider);

            configurator.RegisterStateMachine <OfficeFileProcessingStateMachine, OfficeFileProcessingState>(provider);
        }
示例#6
0
        public static void RegisterInMemoryModule(this IBusFactoryConfigurator configurator, IServiceProvider provider)
        {
            //  register backend consumers...
            configurator.RegisterScopedConsumer <BackEnd.AddImageCommandHandler>(provider, null, c => c.UseCqrsLite());
            configurator.RegisterScopedConsumer <BackEnd.ChangeStatusCommandHandler>(provider, null, c => c.UseCqrsLite());
            configurator.RegisterScopedConsumer <BackEnd.CreateModelCommandHandler>(provider, null, c => c.UseCqrsLite());
            configurator.RegisterScopedConsumer <BackEnd.DeleteModelCommandHandler>(provider, null, c => c.UseCqrsLite());
            configurator.RegisterScopedConsumer <BackEnd.MoveModelCommandHandler>(provider, null, c => c.UseCqrsLite());
            configurator.RegisterScopedConsumer <BackEnd.UpdateModelBlobCommandHandler>(provider, null, c => c.UseCqrsLite());
            configurator.RegisterScopedConsumer <BackEnd.UpdateModelNameCommandHandler>(provider, null, c => c.UseCqrsLite());
            configurator.RegisterScopedConsumer <BackEnd.GrantAccessCommandHandler>(provider, null, c => c.UseCqrsLite());
            configurator.RegisterScopedConsumer <BackEnd.SetTargetsCommandHandler>(provider, null, c => c.UseCqrsLite());
            configurator.RegisterScopedConsumer <BackEnd.SetConsensusWeightCommandHandler>(provider, null, c => c.UseCqrsLite());
            configurator.RegisterScopedConsumer <BackEnd.UpdateModelPropertiesCommandHandler>(provider, null, c => c.UseCqrsLite());

            //  register persistence consumers...
            configurator.RegisterConsumer <Persistence.EventHandlers.ModelsEventHandlers>(provider);
            configurator.RegisterConsumer <Persistence.EventHandlers.NodesEventHandlers>(provider);

            //  register state machines...
            configurator.RegisterStateMachine <ModelTrainingStateMachine, ModelTrainingState>(provider);
            configurator.RegisterStateMachine <PropertiesPredictionStateMachine, PropertiesPredictionState>(provider);
            configurator.RegisterStateMachine <TrainingStateMachine, TrainingState>(provider);
        }
示例#7
0
        public static Task RegisterStateMachines(this IBusFactoryConfigurator configurator, IServiceProvider provider, params Assembly[] assemblies)
        {
            if (assemblies is null || assemblies.Length == 0)
            {
                assemblies = new Assembly[] { Assembly.GetEntryAssembly() };
            }

            var stateMachines = assemblies
                                .SelectMany(a => a.GetTypes())
                                .Where(t => t.BaseType != null && t.BaseType.IsGenericType && t.BaseType.GetGenericTypeDefinition() == typeof(MassTransitStateMachine <>));

            foreach (var t in stateMachines)
            {
                configurator.RegisterStateMachine(t, provider);
            }

            return(Task.CompletedTask);
        }
示例#8
0
 public static Task RegisterStateMachine <TStateMachine>(this IBusFactoryConfigurator configurator, IServiceProvider provider) where TStateMachine : class, StateMachine
 {
     return(configurator.RegisterStateMachine(typeof(TStateMachine), provider));
 }