    001/*
    002 * Licensed to the Apache Software Foundation (ASF) under one or more
    003 * contributor license agreements.  See the NOTICE file distributed with
    004 * this work for additional information regarding copyright ownership.
    005 * The ASF licenses this file to You under the Apache License, Version 2.0
    006 * (the "License"); you may not use this file except in compliance with
    007 * the License.  You may obtain a copy of the License at
    008 *
    009 *     http://www.apache.org/licenses/LICENSE-2.0
    010 *
    011 * Unless required by applicable law or agreed to in writing, software
    012 * distributed under the License is distributed on an "AS IS" BASIS,
    013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    014 * See the License for the specific language governing permissions and
    015 * limitations under the License.
    016 */
    017package org.apache.commons.configuration2.sync;
    018
    019/**
    020 * <p>
    021 * An enumeration used by {@link SynchronizerSupport} to specify how an object is locked.
    022 * </p>
    023 * <p>
    024 * The {@code SynchronizerSupport} interface allows locking an object. This can be done in different ways controlling
    025 * the level of concurrency still possible with the object. One of the constants defined here can be passed in when
    026 * calling the {@code lock()} method of a {@code SynchronizerSupport} object. (Note that at the end of the day it is up
    027 * to a concrete implementation of {@link Synchronizer} how these lock modes are interpreted.)
    028 * </p>
    029 *
    030 * @since 2.0
    031 */
    032public enum LockMode {
    033    /**
    034     * Lock mode <em>READ</em>. The object is accessed in a read-only manner. Typically, this means that other read locks
    035     * can be granted while concurrent writes are not permitted.
    036     */
    037    READ,
    038
    039    /**
    040     * Lock mode <em>WRITE</em>. The object is updated. This usually means that this object is exclusively locked. Attempts
    041     * of other readers or writers will block until the current update operation is complete.
    042     */
    043    WRITE
    044}