public TaskExecutionRepository(ITaskRepository taskRepository,
                                IExecutionTokenRepository executionTokenRepository,
                                IEventsRepository eventsRepository)
 {
     _taskRepository           = taskRepository;
     _executionTokenRepository = executionTokenRepository;
     _eventsRepository         = eventsRepository;
 }
 public TaskExecutionRepository(ITaskRepository taskRepository,
     IExecutionTokenRepository executionTokenRepository,
     IEventsRepository eventsRepository)
 {
     _taskRepository = taskRepository;
     _executionTokenRepository = executionTokenRepository;
     _eventsRepository = eventsRepository;
 }
Exemplo n.º 3
0
        public TasklingClient(IConfigurationReader configurationReader,
                              ITaskRepository taskRepository                       = null,
                              ITasklingConfiguration configuration                 = null,
                              ITaskExecutionRepository taskExecutionRepository     = null,
                              IExecutionTokenRepository executionTokenRepository   = null,
                              ICommonTokenRepository commonTokenRepository         = null,
                              IEventsRepository eventsRepository                   = null,
                              ICriticalSectionRepository criticalSectionRepository = null,
                              IBlockFactory blockFactory                   = null,
                              IBlockRepository blockRepository             = null,
                              IRangeBlockRepository rangeBlockRepository   = null,
                              IListBlockRepository listBlockRepository     = null,
                              IObjectBlockRepository objectBlockRepository = null,
                              ICleanUpService cleanUpService               = null,
                              ICleanUpRepository cleanUpRepository         = null)
        {
            if (taskRepository == null)
            {
                taskRepository = new TaskRepository();
            }

            if (configuration == null)
            {
                _configuration = new TasklingConfiguration(configurationReader);
            }

            if (commonTokenRepository == null)
            {
                commonTokenRepository = new CommonTokenRepository();
            }

            if (executionTokenRepository == null)
            {
                executionTokenRepository = new ExecutionTokenRepository(commonTokenRepository);
            }

            if (eventsRepository == null)
            {
                eventsRepository = new EventsRepository();
            }

            if (taskExecutionRepository != null)
            {
                _taskExecutionRepository = taskExecutionRepository;
            }
            else
            {
                _taskExecutionRepository = new TaskExecutionRepository(taskRepository, executionTokenRepository, eventsRepository);
            }

            if (criticalSectionRepository != null)
            {
                _criticalSectionRepository = criticalSectionRepository;
            }
            else
            {
                _criticalSectionRepository = new CriticalSectionRepository(taskRepository, commonTokenRepository);
            }

            if (blockRepository == null)
            {
                blockRepository = new BlockRepository(taskRepository);
            }

            if (rangeBlockRepository != null)
            {
                _rangeBlockRepository = rangeBlockRepository;
            }
            else
            {
                _rangeBlockRepository = new RangeBlockRepository(taskRepository);
            }

            if (listBlockRepository != null)
            {
                _listBlockRepository = listBlockRepository;
            }
            else
            {
                _listBlockRepository = new ListBlockRepository(taskRepository);
            }

            if (objectBlockRepository != null)
            {
                _objectBlockRepository = objectBlockRepository;
            }
            else
            {
                _objectBlockRepository = new ObjectBlockRepository(taskRepository);
            }

            if (blockFactory != null)
            {
                _blockFactory = blockFactory;
            }
            else
            {
                _blockFactory = new BlockFactory(blockRepository, _rangeBlockRepository, _listBlockRepository, _objectBlockRepository, _taskExecutionRepository);
            }

            if (cleanUpRepository == null)
            {
                cleanUpRepository = new CleanUpRepository(taskRepository);
            }

            if (cleanUpService != null)
            {
                _cleanUpService = cleanUpService;
            }
            else
            {
                _cleanUpService = new CleanUpService(_configuration, cleanUpRepository);
            }
        }
Exemplo n.º 4
0
        public TasklingClient(IConfigurationReader configurationReader,
            ITaskRepository taskRepository = null,
            ITasklingConfiguration configuration = null,
            ITaskExecutionRepository taskExecutionRepository = null,
            IExecutionTokenRepository executionTokenRepository = null,
            ICommonTokenRepository commonTokenRepository = null,
            IEventsRepository eventsRepository = null,
            ICriticalSectionRepository criticalSectionRepository = null,
            IBlockFactory blockFactory = null,
            IBlockRepository blockRepository = null,
            IRangeBlockRepository rangeBlockRepository = null,
            IListBlockRepository listBlockRepository = null,
            IObjectBlockRepository objectBlockRepository = null,
            ICleanUpService cleanUpService = null,
            ICleanUpRepository cleanUpRepository = null)
        {
            if (taskRepository == null)
                taskRepository = new TaskRepository();

            if (configuration == null)
                _configuration = new TasklingConfiguration(configurationReader);

            if (commonTokenRepository == null)
                commonTokenRepository = new CommonTokenRepository();

            if (executionTokenRepository == null)
                executionTokenRepository = new ExecutionTokenRepository(commonTokenRepository);

            if (eventsRepository == null)
                eventsRepository = new EventsRepository();

            if (taskExecutionRepository != null)
                _taskExecutionRepository = taskExecutionRepository;
            else
                _taskExecutionRepository = new TaskExecutionRepository(taskRepository, executionTokenRepository, eventsRepository);

            if (criticalSectionRepository != null)
                _criticalSectionRepository = criticalSectionRepository;
            else
                _criticalSectionRepository = new CriticalSectionRepository(taskRepository, commonTokenRepository);

            if (blockRepository == null)
                blockRepository = new BlockRepository(taskRepository);

            if (rangeBlockRepository != null)
                _rangeBlockRepository = rangeBlockRepository;
            else
                _rangeBlockRepository = new RangeBlockRepository(taskRepository);

            if (listBlockRepository != null)
                _listBlockRepository = listBlockRepository;
            else
                _listBlockRepository = new ListBlockRepository(taskRepository);

            if (objectBlockRepository != null)
                _objectBlockRepository = objectBlockRepository;
            else
                _objectBlockRepository = new ObjectBlockRepository(taskRepository);

            if (blockFactory != null)
                _blockFactory = blockFactory;
            else
                _blockFactory = new BlockFactory(blockRepository, _rangeBlockRepository, _listBlockRepository, _objectBlockRepository, _taskExecutionRepository);

            if (cleanUpRepository == null)
                cleanUpRepository = new CleanUpRepository(taskRepository);

            if (cleanUpService != null)
                _cleanUpService = cleanUpService;
            else
                _cleanUpService = new CleanUpService(_configuration, cleanUpRepository);
        }