blob: 8a85b3244f8d45ba29da4ac5f26da7bf0eb0374c [file] [log] [blame]
// Copyright (C) 2017 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.server.project;
import java.util.concurrent.locks.Lock;
/**
* A global locking mechanism.
*
* <p>This is an interface because distributed setup may need something beyond an in-memory lock.
*
* <p>A Gerrit system consisting of a single Gerrit server only needs an in-memory lock manager
* which is implemented by the DefaultLockManager.
*
* <p>A distributed setup, consisting of more than one Gerrit server, can implement a distributed
* lock manager that provides global locks.
*/
public interface LockManager {
public Lock getLock(String name);
}