Refactor renamed ILock to IDistributedLock.

Also refactored the IDistributedLockService to be more in line with general .NET patterns by return a boolean from the TryAcquire method.
This commit is contained in:
Sipke Schoorstra
2015-08-10 12:47:53 +01:00
parent f363ac2b5f
commit 5813647574
8 changed files with 27 additions and 29 deletions

View File

@@ -13,10 +13,10 @@ using Orchard.Validation;
namespace Orchard.TaskLease.Services {
/// <summary>
/// Provides a database driven implementation of <see cref="ILock" />
/// Provides a database driven implementation of <see cref="IDistributedLock" />
/// </summary>
[OrchardSuppressDependency("Orchard.Tasks.Locking.DefaultLock")]
public class DatabaseLock : ILock {
public class DatabaseLock : IDistributedLock {
private readonly ILifetimeScope _lifetimeScope;
private readonly IClock _clock;
private string _name;

View File

@@ -1,5 +1,4 @@
using System;
using Orchard.TaskLease.Models;
namespace Orchard.TaskLease.Services {
@@ -7,7 +6,7 @@ namespace Orchard.TaskLease.Services {
/// Describes a service to save and acquire task leases. A task lease can't be acquired by two different machines,
/// for a specific amount of time. Optionnally a State can be saved along with the lease.
/// </summary>
[Obsolete("Use Orchard.Tasks.Locking.ILockService instead.")]
[Obsolete("Use Orchard.Tasks.Locking.IDistributedLockService instead.")]
public interface ITaskLeaseService : IDependency {
/// <summary>

View File

@@ -9,7 +9,7 @@ namespace Orchard.TaskLease.Services {
/// <summary>
/// Provides a database driven implementation of <see cref="ITaskLeaseService" />
/// </summary>
[Obsolete("Use Orchard.Tasks.Locking.ILockService instead.")]
[Obsolete("Use Orchard.Tasks.Locking.DistributedLockService instead.")]
public class TaskLeaseService : ITaskLeaseService {
private readonly IRepository<TaskLeaseRecord> _repository;