Example #1
0
 public SingleInstanceProcess(IDistributedLockService lockService, T innerProcess)
 {
     _lockService  = lockService;
     _innerProcess = innerProcess;
     ProcessName   = innerProcess.ProcessName;
     ProcessId     = innerProcess.ProcessId;
 }
Example #2
0
 public DistributedLockMiddleware(
     IDistributedLockService distributedLockService,
     ILogger logger,
     Func <TRequest, CancellationToken, Task <string> > createLockDelegate)
 {
     _distributedLockService = distributedLockService;
     _logger             = logger;
     _createLockDelegate = createLockDelegate;
 }
        public AuditTrailTrimmingBackgroundTask(
            ISiteService siteService,
            IClock clock,
            IAuditTrailManager auditTrailManager,
            IDistributedLockService distributedLockService) {

            _siteService = siteService;
            _clock = clock;
            _auditTrailManager = auditTrailManager;
            _distributedLockService = distributedLockService;
        }
 public AuditTrailTrimmingBackgroundTask(
     ISiteService siteService,
     IClock clock,
     IAuditTrailManager auditTrailManager,
     IDistributedLockService distributedLockService)
 {
     _siteService            = siteService;
     _clock                  = clock;
     _auditTrailManager      = auditTrailManager;
     _distributedLockService = distributedLockService;
 }
Example #5
0
 public JobProcessor(
     IWamsClient wamsClient,
     IAssetManager assetManager,
     IJobManager jobManager,
     IOrchardServices orchardServices,
     IDistributedLockService distributedLockService)
 {
     _wamsClient             = wamsClient;
     _assetManager           = assetManager;
     _jobManager             = jobManager;
     _orchardServices        = orchardServices;
     _distributedLockService = distributedLockService;
 }
Example #6
0
        public JobProcessor(
            IWamsClient wamsClient,
            IAssetManager assetManager,
            IJobManager jobManager,
            IOrchardServices orchardServices,
            IDistributedLockService distributedLockService) {

            _wamsClient = wamsClient;
            _assetManager = assetManager;
            _jobManager = jobManager;
            _orchardServices = orchardServices;
            _distributedLockService = distributedLockService;
        }
Example #7
0
        public AutomaticDataMigrations(
            IDataMigrationManager dataMigrationManager,
            IDataMigrationInterpreter dataMigrationInterpreter,
            IFeatureManager featureManager,
            IDistributedLockService distributedLockService,
            ITransactionManager transactionManager,
            ShellSettings shellSettings)
        {
            _dataMigrationManager     = dataMigrationManager;
            _featureManager           = featureManager;
            _distributedLockService   = distributedLockService;
            _shellSettings            = shellSettings;
            _transactionManager       = transactionManager;
            _dataMigrationInterpreter = dataMigrationInterpreter;

            Logger = NullLogger.Instance;
        }
Example #8
0
        public AutomaticDataMigrations(
            IDataMigrationManager dataMigrationManager,
            IDataMigrationInterpreter dataMigrationInterpreter,
            IFeatureManager featureManager,
            IDistributedLockService distributedLockService,
            ITransactionManager transactionManager,
            ShellSettings shellSettings) {

            _dataMigrationManager = dataMigrationManager;
            _featureManager = featureManager;
            _distributedLockService = distributedLockService;
            _shellSettings = shellSettings;
            _transactionManager = transactionManager;
            _dataMigrationInterpreter = dataMigrationInterpreter;

            Logger = NullLogger.Instance;
        }
Example #9
0
 public CoreDependencies(
     ILoggerFactory loggerFactory,
     IServiceLogger serviceLogger,
     ICodeWorksTokenizer tokenizer,
     IRateLimiter rateLimiter,
     IDistributedLockService distributedLockService,
     IServiceEnvironmentResolver environmentResolver,
     IRequestValidator requestValidator,
     IChainedServiceResolver chainedServiceResolver,
     IUserResolver userResolver)
 {
     LoggerFactory          = loggerFactory;
     ServiceLogger          = serviceLogger;
     Tokenizer              = tokenizer;
     RateLimiter            = rateLimiter;
     DistributedLockService = distributedLockService;
     EnvironmentResolver    = environmentResolver;
     RequestValidator       = requestValidator;
     ChainedServiceResolver = chainedServiceResolver;
     UserResolver           = userResolver;
 }
Example #10
0
 /// <summary>
 /// Acquires a named distributed lock with no expiration time within the current tenant.
 /// </summary>
 /// <param name="name">The name to use for the lock.</param>
 /// <returns>The acquired lock.</returns>
 /// <remarks>This method blocks indefinitely until the lock can be acquired.</remarks>
 public static IDistributedLock AcquireLock(this IDistributedLockService service, string name)
 {
     return(service.AcquireLock(name, null, null));
 }
Example #11
0
 /// <summary>
 /// Acquires a named distributed lock with a given expiration time within the current tenant.
 /// </summary>
 /// <param name="name">The name of the lock to acquire.</param>
 /// <param name="maxValidFor">The maximum amount of time the lock should be held before automatically expiring. This is a safeguard in case the owner fails to release the lock. If <c>null</c> is specified, the lock never automatically expires.</param>
 /// <returns>The acquired lock.</returns>
 /// <remarks>This method blocks indefinitely until the lock can be acquired.</remarks>
 public static IDistributedLock AcquireLock(this IDistributedLockService service, string name, TimeSpan?maxValidFor)
 {
     return(service.AcquireLock(name, maxValidFor, null));
 }
Example #12
0
 /// <summary>
 /// Tries to immediately acquire a named distributed lock with no expiration time within the current tenant.
 /// </summary>
 /// <param name="name">The name of the lock to acquire.</param>
 /// <param name="lock">This out parameter will be assigned the acquired lock if successful.</param>
 /// <returns><c>true</c> if the lock could be immediately acquired, otherwise <c>false</c>.</returns>
 public static bool TryAcquireLock(this IDistributedLockService service, string name, out IDistributedLock @lock)
 {
     return(service.TryAcquireLock(name, null, TimeSpan.Zero, out @lock));
 }
Example #13
0
 public QueueTimeoutBackgroundProcess(IDistributedLockService lockService, QueuesFaultManager queuesFaultManager)
     : base(lockService, new QueueTimeoutBackgroundAction(queuesFaultManager))
 {
 }