Exemplo n.º 1
0
        public TaskExecutionContext(ITasklingConfiguration configuration,
                                    ITaskExecutionRepository taskExecutionRepository,
                                    ICriticalSectionRepository criticalSectionRepository,
                                    IBlockFactory blockFactory,
                                    IRangeBlockRepository rangeBlockRepository,
                                    IListBlockRepository listBlockRepository,
                                    IObjectBlockRepository objectBlockRepository,
                                    ICleanUpService cleanUpService,
                                    string applicationName,
                                    string taskName,
                                    TaskExecutionOptions taskExecutionOptions)
        {
            _configuration             = configuration;
            _taskExecutionRepository   = taskExecutionRepository;
            _criticalSectionRepository = criticalSectionRepository;
            _blockFactory          = blockFactory;
            _rangeBlockRepository  = rangeBlockRepository;
            _listBlockRepository   = listBlockRepository;
            _objectBlockRepository = objectBlockRepository;
            _cleanUpService        = cleanUpService;

            _taskExecutionInstance = new TaskExecutionInstance();
            _taskExecutionInstance.ApplicationName = applicationName;
            _taskExecutionInstance.TaskName        = taskName;

            _taskExecutionOptions = taskExecutionOptions;

            _executionHasFailed = false;

            _taskConfiguration = _configuration.GetTaskConfiguration(applicationName, taskName);
        }
Exemplo n.º 2
0
        public ListBlockContextBase(IListBlockRepository listBlockRepository,
                                    ITaskExecutionRepository taskExecutionRepository,
                                    string applicationName,
                                    string taskName,
                                    string taskExecutionId,
                                    ListUpdateMode listUpdateMode,
                                    int uncommittedThreshold,
                                    ListBlock <TItem, THeader> listBlock,
                                    string blockExecutionId,
                                    int maxStatusReasonLength,
                                    string forcedBlockQueueId = "0")
        {
            _listBlockRepository     = listBlockRepository;
            _taskExecutionRepository = taskExecutionRepository;
            _blockWithHeader         = listBlock;
            BlockExecutionId         = blockExecutionId;
            ListUpdateMode           = listUpdateMode;
            ForcedBlockQueueId       = forcedBlockQueueId;
            UncommittedThreshold     = uncommittedThreshold;
            _applicationName         = applicationName;
            _taskName              = taskName;
            _taskExecutionId       = taskExecutionId;
            _maxStatusReasonLength = maxStatusReasonLength;

            if (listUpdateMode != ListUpdateMode.SingleItemCommit)
            {
                _uncommittedItems = new List <IListBlockItem <TItem> >();
            }

            _completed = false;
            _hasHeader = true;
        }
Exemplo n.º 3
0
 public ListBlockContext(IListBlockRepository listBlockRepository,
                         ITaskExecutionRepository taskExecutionRepository,
                         string applicationName,
                         string taskName,
                         string taskExecutionId,
                         ListUpdateMode listUpdateMode,
                         int uncommittedThreshold,
                         ListBlock <T> listBlock,
                         string blockExecutionId,
                         int maxStatusReasonLength,
                         string forcedBlockQueueId = "0")
     : base(listBlockRepository,
            taskExecutionRepository,
            applicationName,
            taskName,
            taskExecutionId,
            listUpdateMode,
            uncommittedThreshold,
            listBlock,
            blockExecutionId,
            maxStatusReasonLength,
            forcedBlockQueueId)
 {
     _headerlessBlock.SetParentContext(this);
 }
Exemplo n.º 4
0
 public CleanUpService(ITasklingConfiguration tasklingConfiguration,
                       ICleanUpRepository cleanUpRepository,
                       ITaskExecutionRepository taskExecutionRepository)
 {
     _cleanUpRepository       = cleanUpRepository;
     _tasklingConfiguration   = tasklingConfiguration;
     _taskExecutionRepository = taskExecutionRepository;
 }
Exemplo n.º 5
0
 public BlockFactory(IBlockRepository blockRepository,
                     IRangeBlockRepository rangeBlockRepository,
                     IListBlockRepository listBlockRepository,
                     IObjectBlockRepository objectBlockRepository,
                     ITaskExecutionRepository taskExecutionRepository)
 {
     _blockRepository         = blockRepository;
     _rangeBlockRepository    = rangeBlockRepository;
     _listBlockRepository     = listBlockRepository;
     _objectBlockRepository   = objectBlockRepository;
     _taskExecutionRepository = taskExecutionRepository;
 }
Exemplo n.º 6
0
 public RangeBlockContext(IRangeBlockRepository rangeBlockRepository,
                          ITaskExecutionRepository taskExecutionRepository,
                          string applicationName,
                          string taskName,
                          string taskExecutionId,
                          RangeBlock rangeBlock,
                          string blockExecutionId,
                          string forcedBlockQueueId = "0")
 {
     _rangeBlockRepository    = rangeBlockRepository;
     _taskExecutionRepository = taskExecutionRepository;
     _block             = rangeBlock;
     BlockExecutionId   = blockExecutionId;
     ForcedBlockQueueId = forcedBlockQueueId;
     _applicationName   = applicationName;
     _taskName          = taskName;
     _taskExecutionId   = taskExecutionId;
 }
Exemplo n.º 7
0
 public ObjectBlockContext(IObjectBlockRepository objectBlockRepository,
                           ITaskExecutionRepository taskExecutionRepository,
                           string applicationName,
                           string taskName,
                           string taskExecutionId,
                           ObjectBlock <T> block,
                           string blockExecutionId,
                           string forcedBlockQueueId = "0")
 {
     _objectBlockRepository   = objectBlockRepository;
     _taskExecutionRepository = taskExecutionRepository;
     Block              = block;
     BlockExecutionId   = blockExecutionId;
     ForcedBlockQueueId = forcedBlockQueueId;
     _applicationName   = applicationName;
     _taskName          = taskName;
     _taskExecutionId   = taskExecutionId;
 }
Exemplo n.º 8
0
 public RangeBlockContext(IRangeBlockRepository rangeBlockRepository,
     ITaskExecutionRepository taskExecutionRepository,
     string applicationName,
     string taskName,
     string taskExecutionId,
     RangeBlock rangeBlock,
     string blockExecutionId,
     string forcedBlockQueueId = "0")
 {
     _rangeBlockRepository = rangeBlockRepository;
     _taskExecutionRepository = taskExecutionRepository;
     _block = rangeBlock;
     BlockExecutionId = blockExecutionId;
     ForcedBlockQueueId = forcedBlockQueueId;
     _applicationName = applicationName;
     _taskName = taskName;
     _taskExecutionId = taskExecutionId;
 }
Exemplo n.º 9
0
 public KeepAliveDaemon(ITaskExecutionRepository taskExecutionRepository, WeakReference owner)
 {
     _owner = owner;
     _taskExecutionRepository = taskExecutionRepository;
 }
Exemplo n.º 10
0
 public TaskExecutionController(IFrontendUserRepository frontendUserRepository,
                                ITaskTemplateRepository taskTemplateRepository, ITaskExecutionRepository taskExecutionRepository) : base(
         taskExecutionRepository)
 {
     _frontendUserRepository = frontendUserRepository;
     _taskTemplateRepository = taskTemplateRepository;
 }
Exemplo n.º 11
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.º 12
0
        public TasklingClient(IConfigurationReader configurationReader,
                              CustomDependencies customDependencies)
        {
            if (customDependencies.TaskRepository == null)
            {
                customDependencies.TaskRepository = new TaskRepository();
            }

            if (customDependencies.Configuration == null)
            {
                _configuration = new TasklingConfiguration(configurationReader);
            }

            if (customDependencies.CommonTokenRepository == null)
            {
                customDependencies.CommonTokenRepository = new CommonTokenRepository();
            }

            if (customDependencies.ExecutionTokenRepository == null)
            {
                customDependencies.ExecutionTokenRepository = new ExecutionTokenRepository(customDependencies.CommonTokenRepository);
            }

            if (customDependencies.EventsRepository == null)
            {
                customDependencies.EventsRepository = new EventsRepository();
            }

            if (customDependencies.TaskExecutionRepository != null)
            {
                _taskExecutionRepository = customDependencies.TaskExecutionRepository;
            }
            else
            {
                _taskExecutionRepository = new TaskExecutionRepository(customDependencies.TaskRepository, customDependencies.ExecutionTokenRepository, customDependencies.EventsRepository);
            }

            if (customDependencies.CriticalSectionRepository != null)
            {
                _criticalSectionRepository = customDependencies.CriticalSectionRepository;
            }
            else
            {
                _criticalSectionRepository = new CriticalSectionRepository(customDependencies.TaskRepository, customDependencies.CommonTokenRepository);
            }

            if (customDependencies.BlockRepository == null)
            {
                customDependencies.BlockRepository = new BlockRepository(customDependencies.TaskRepository);
            }

            if (customDependencies.RangeBlockRepository != null)
            {
                _rangeBlockRepository = customDependencies.RangeBlockRepository;
            }
            else
            {
                _rangeBlockRepository = new RangeBlockRepository(customDependencies.TaskRepository);
            }

            if (customDependencies.ListBlockRepository != null)
            {
                _listBlockRepository = customDependencies.ListBlockRepository;
            }
            else
            {
                _listBlockRepository = new ListBlockRepository(customDependencies.TaskRepository);
            }

            if (customDependencies.ObjectBlockRepository != null)
            {
                _objectBlockRepository = customDependencies.ObjectBlockRepository;
            }
            else
            {
                _objectBlockRepository = new ObjectBlockRepository(customDependencies.TaskRepository);
            }

            if (customDependencies.BlockFactory != null)
            {
                _blockFactory = customDependencies.BlockFactory;
            }
            else
            {
                _blockFactory = new BlockFactory(customDependencies.BlockRepository, _rangeBlockRepository, _listBlockRepository, _objectBlockRepository, _taskExecutionRepository);
            }

            if (customDependencies.CleanUpRepository == null)
            {
                customDependencies.CleanUpRepository = new CleanUpRepository(customDependencies.TaskRepository);
            }

            if (customDependencies.CleanUpService != null)
            {
                _cleanUpService = customDependencies.CleanUpService;
            }
            else
            {
                _cleanUpService = new CleanUpService(_configuration, customDependencies.CleanUpRepository);
            }
        }
Exemplo n.º 13
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.º 14
0
        public TasklingClient(IConfigurationReader configurationReader,
            CustomDependencies customDependencies)
        {
            if (customDependencies.TaskRepository == null)
                customDependencies.TaskRepository = new TaskRepository();

            if (customDependencies.Configuration == null)
                _configuration = new TasklingConfiguration(configurationReader);

            if (customDependencies.CommonTokenRepository == null)
                customDependencies.CommonTokenRepository = new CommonTokenRepository();

            if (customDependencies.ExecutionTokenRepository == null)
                customDependencies.ExecutionTokenRepository = new ExecutionTokenRepository(customDependencies.CommonTokenRepository);

            if (customDependencies.EventsRepository == null)
                customDependencies.EventsRepository = new EventsRepository();

            if (customDependencies.TaskExecutionRepository != null)
                _taskExecutionRepository = customDependencies.TaskExecutionRepository;
            else
                _taskExecutionRepository = new TaskExecutionRepository(customDependencies.TaskRepository, customDependencies.ExecutionTokenRepository, customDependencies.EventsRepository);

            if (customDependencies.CriticalSectionRepository != null)
                _criticalSectionRepository = customDependencies.CriticalSectionRepository;
            else
                _criticalSectionRepository = new CriticalSectionRepository(customDependencies.TaskRepository, customDependencies.CommonTokenRepository);

            if (customDependencies.BlockRepository == null)
                customDependencies.BlockRepository = new BlockRepository(customDependencies.TaskRepository);

            if (customDependencies.RangeBlockRepository != null)
                _rangeBlockRepository = customDependencies.RangeBlockRepository;
            else
                _rangeBlockRepository = new RangeBlockRepository(customDependencies.TaskRepository);

            if (customDependencies.ListBlockRepository != null)
                _listBlockRepository = customDependencies.ListBlockRepository;
            else
                _listBlockRepository = new ListBlockRepository(customDependencies.TaskRepository);

            if (customDependencies.ObjectBlockRepository != null)
                _objectBlockRepository = customDependencies.ObjectBlockRepository;
            else
                _objectBlockRepository = new ObjectBlockRepository(customDependencies.TaskRepository);

            if (customDependencies.BlockFactory != null)
                _blockFactory = customDependencies.BlockFactory;
            else
                _blockFactory = new BlockFactory(customDependencies.BlockRepository, _rangeBlockRepository, _listBlockRepository, _objectBlockRepository, _taskExecutionRepository);

            if (customDependencies.CleanUpRepository == null)
                customDependencies.CleanUpRepository = new CleanUpRepository(customDependencies.TaskRepository);

            if (customDependencies.CleanUpService != null)
                _cleanUpService = customDependencies.CleanUpService;
            else
                _cleanUpService = new CleanUpService(_configuration, customDependencies.CleanUpRepository);
        }
Exemplo n.º 15
0
 public KeepAliveDaemon(ITaskExecutionRepository taskExecutionRepository, WeakReference owner)
 {
     _owner = owner;
     _taskExecutionRepository = taskExecutionRepository;
 }