org.infinispan.context.SingleKeyNonTxInvocationContext Maven / Gradle / Ivy
package org.infinispan.context;
import org.infinispan.commons.equivalence.Equivalence;
import org.infinispan.container.entries.CacheEntry;
import org.infinispan.remoting.transport.Address;
import java.util.Collections;
import java.util.Map;
import java.util.Set;
/**
* @author Mircea Markus
* @author Sanne Grinovero
* @since 5.1
*/
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 reference to Equivalence to InvocationContextFactory (Memory allocation cost)
private final Equivalence keyEquivalence;
//TODO move reference to ClassLoader to InvocationContextFactory (Memory allocation cost)
private ClassLoader classLoader;
//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, final Equivalence