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

net.sf.javagimmicks.concurrent.locks.MultiReadWriteLock Maven / Gradle / Ivy

There is a newer version: 0.99-alpha1
Show newest version
package net.sf.javagimmicks.concurrent.locks;

import java.util.Collection;
import java.util.concurrent.locks.ReadWriteLock;

/**
 * An extension of {@link ReadWriteLock} that allows atomic locking on any
 * number of resources (which can be identified by resource identifiers).
 * 

* Instances must be generated by a {@link MultiLockProvider} (which also takes * care about resource identifier management). * * @param * The type of the internally used resource identifiers * @see MultiLockProvider#newLock(Iterable) * @see MultiLockProvider#newLock(Object...) */ public interface MultiReadWriteLock extends ReadWriteLock { /** * Returns the resource identifiers with which this instance is associated. * * @return the resource identifiers with which this instance is associated. */ Collection getResourceIds(); /** * Returns a read-only {@link MultiLock} that is associated with the resource * identifiers with which this instance is associated. * * @return a read-only {@link MultiLock} for the associated resource * identifiers */ @Override MultiLock readLock(); /** * Returns a write-access {@link MultiLock} that is associated with the * resource identifiers with which this instance is associated. * * @return a write-access {@link MultiLock} for the associated resource * identifiers */ @Override MultiLock writeLock(); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy