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

org.infinispan.util.concurrent.locks.RemoteLockCommand Maven / Gradle / Ivy

There is a newer version: 9.1.7.Final
Show newest version
package org.infinispan.util.concurrent.locks;

import java.util.Collection;

import org.infinispan.commands.ReplicableCommand;

/**
 * Simple interface to extract all the keys that may need to be locked.
 * 

* A {@link org.infinispan.commands.remote.CacheRpcCommand} that needs to acquire locks should implement this interface. * This way, Infinispan tries to provide a better management to optimize the system resources usage. * * @author Pedro Ruivo * @since 8.0 */ public interface RemoteLockCommand extends ReplicableCommand { /** * It returns a {@link Collection} with the keys to be lock. *

* It may return an empty collection if no keys needs to be locked independently of the return value of {@link * #hasSkipLocking()}. It may contains duplicated keys and {@code null} is not a valid return value. * * @return a {@link Collection} of keys to lock. */ Collection getKeysToLock(); /** * It returns the lock owner of the key. *

* Usually, in transaction caches it is the {@link org.infinispan.transaction.xa.GlobalTransaction} and in * non-transactional caches the {@link org.infinispan.commands.CommandInvocationId}. * * @return the lock owner of the key. */ Object getKeyLockOwner(); /** * @return it the locks should be acquire with 0 (zero) acquisition timeout. */ boolean hasZeroLockAcquisition(); /** * It checks if this command should acquire locks. * * @return {@code true} if locks should be acquired for the keys in {@link #getKeysToLock()}. */ boolean hasSkipLocking(); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy