org.infinispan.context.SingleKeyNonTxInvocationContext Maven / Gradle / Ivy
package org.infinispan.context;
import java.util.Collections;
import java.util.Map;
import java.util.Set;
import java.util.function.BiConsumer;
import org.infinispan.container.entries.CacheEntry;
import org.infinispan.remoting.transport.Address;
/**
* @author Mircea Markus
* @author Sanne Grinovero
* @deprecated Since 9.0, this class is going to be moved to an internal package.
*/
@Deprecated
public final class SingleKeyNonTxInvocationContext implements InvocationContext {
/**
* It is possible for the key to only be wrapped but not locked, e.g. when a get takes place.
*/
private boolean isLocked;
private Object key;
private CacheEntry cacheEntry;
//TODO move the Origin's address to the InvocationContextFactory when isOriginLocal=true -> all addresses are the same (Memory allocation cost)
//(verify if this is worth it by looking at object alignment - would need a different implementation as pointing to null wouldn't help)
private final Address origin;
private Object lockOwner;
public SingleKeyNonTxInvocationContext(final Address origin) {
this.origin = origin;
}
@Override
public boolean isOriginLocal() {
return origin == null;
}
@Override
public boolean isInTxScope() {
return false;
}
@Override
public Object getLockOwner() {
return lockOwner;
}
@Override
public void setLockOwner(Object lockOwner) {
this.lockOwner = lockOwner;
}
@Override
public InvocationContext clone() {
try {
return (InvocationContext) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Impossible!", e);
}
}
@Override
public Set
© 2015 - 2025 Weber Informatics LLC | Privacy Policy