public LockingIndex(StringComparison wordComparison, [NotNull] LockingStrategy locking) { if (locking == null) { throw new ArgumentNullException("locking"); } this.wordComparer = new StringComparisonComparer(wordComparison); this.wordIndex = new SortedList <string, ISet <DocumentInfo> >(wordComparer); this.allDocuments = new HashSet <DocumentInfo>(); this.locking = locking; }
public static ILockStrategy Create(LockingStrategy strategy) { switch (strategy) { case LockingStrategy.ReaderWriter: return new ReaderWriterLockStrategy(); case LockingStrategy.Exclusive: return new ExclusiveLockStrategy(); default: throw new ArgumentOutOfRangeException(); } }
public static ILockStrategy Create(LockingStrategy strategy) { switch (strategy) { case LockingStrategy.ReaderWriter: return(new ReaderWriterLockStrategy()); case LockingStrategy.Exclusive: return(new ExclusiveLockStrategy()); default: throw new ArgumentOutOfRangeException(); } }
public SharedDictionary(LockingStrategy strategy) : this(LockingStrategyFactory.Create(strategy)) { }
// Locking public static FrameworkConfigurator SetLockingStrategy(this FrameworkConfigurator configurator, LockingStrategy lockingStrategy) { throw new NotSupportedException("Not yet supported."); return(configurator); }
/// <summary> /// Initializes a new instance of the <see cref="SharedList{T}"/> class. /// </summary> /// <param name="strategy">The locking strategy to use.</param> public SharedList(LockingStrategy strategy) : this(LockingStrategyFactory.Create(strategy)) { }
/** * @param strategy Ticket cleanup locking strategy. An exclusive locking * strategy is preferable if not required for some ticket backing stores, * such as JPA, in a clustered CAS environment. Use {@link JdbcLockingStrategy} * for {@link org.jasig.cas.ticket.registry.JpaTicketRegistry} in a clustered * CAS environment. */ public void setLock(LockingStrategy strategy) { this._lock = strategy; }