All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.oracle.coherence.common.base.Lockable Maven / Gradle / Ivy

There is a newer version: 24.09
Show newest version
/*
 * Copyright (c) 2000, 2021, Oracle and/or its affiliates.
 *
 * Licensed under the Universal Permissive License v 1.0 as shown at
 * http://oss.oracle.com/licenses/upl.
 */
package com.oracle.coherence.common.base;

import com.tangosol.util.NullImplementation;

/**
 * The Lockable interface is used for managing exclusive access to thread-safe
 * classes.
 *
 * @author bbc  2021.12.06
 */
public interface Lockable
    {
    /**
     * Suggest to this Lockable that the caller requires exclusive access
     * until {@link AutoCloseable#close() close} is called on the
     * returned {@link AutoCloseable}.
     * 

* Note: the caller must call {@link AutoCloseable#close() close} on * the returned object * * @return an {@link AutoCloseable} object that requires close to be * called on it when exclusive access is no longer needed */ public default Unlockable exclusively() { return null; } /** * The Unlockable interface is used for releasing the exclusive access to * this Lockable. */ public interface Unlockable extends AutoCloseable { /** * Release the acquired exclusive access to this Lockable. */ void close(); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy