2
* Licensed to the Apache Software Foundation (ASF) under one or more
3
* contributor license agreements. See the NOTICE file distributed with
4
* this work for additional information regarding copyright ownership.
5
* The ASF licenses this file to You under the Apache License, Version 2.0
6
* (the "License"); you may not use this file except in compliance with
7
* the License. You may obtain a copy of the License at
9
* http://www.apache.org/licenses/LICENSE-2.0
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
20
namespace Lucene.Net.Store
23
/// <summary> Base class for Locking implementation. {@link Directory} uses
24
/// instances of this class to implement locking.
27
public abstract class LockFactory
30
protected internal System.String lockPrefix = "";
32
/// <summary> Set the prefix in use for all locks created in this
33
/// LockFactory. This is normally called once, when a
34
/// Directory gets this LockFactory instance. However, you
35
/// can also call this (after this instance is assigned to
36
/// a Directory) to override the prefix in use. This
37
/// is helpful if you're running Lucene on machines that
38
/// have different mount points for the same shared
41
public virtual void SetLockPrefix(System.String lockPrefix)
43
this.lockPrefix = lockPrefix;
46
/// <summary> Get the prefix in use for all locks created in this LockFactory.</summary>
47
public virtual System.String GetLockPrefix()
49
return this.lockPrefix;
52
/// <summary> Return a new Lock instance identified by lockName.</summary>
53
/// <param name="lockName">name of the lock to be created.
55
public abstract Lock MakeLock(System.String lockName);
57
/// <summary> Attempt to clear (forcefully unlock and remove) the
58
/// specified lock. Only call this at a time when you are
59
/// certain this lock is no longer in use.
61
/// <param name="lockName">name of the lock to be cleared.
63
abstract public void ClearLock(System.String lockName);
b'\\ No newline at end of file'