com.zipwhip.concurrent.SafetyBoundary Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zipwhip-api Show documentation
Show all versions of zipwhip-api Show documentation
Java client to support applications powered by the Zipwhip Cloud
The newest version!
package com.zipwhip.concurrent;
import com.zipwhip.util.Asserts;
import com.zipwhip.util.Directory;
import java.util.Collection;
import java.util.Map;
/**
* Created with IntelliJ IDEA.
* User: Michael
* Date: 9/8/12
* Time: 4:14 PM
* To change this template use File | Settings | File Templates.
*/
public class SafetyBoundary {
private Map> locks;
enum Access {
/**
* You want to read the value and have it not change.
*/
READ,
/**
* You want to write a new value.
*/
WRITE,
/**
* You want to change something on the value.
*/
MODIFY
}
public void add(Access access, T key, Object object) {
locks.get(access).add(key, object);
}
protected void ensureAbleTo(Access access, T key) {
Collection
© 2015 - 2025 Weber Informatics LLC | Privacy Policy