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

org.infinispan.lock.api.ClusteredLockConfiguration Maven / Gradle / Ivy

There is a newer version: 15.1.0.Dev04
Show newest version
package org.infinispan.lock.api;

/**
 * A Clustered Lock can be reentrant and there are different ownership levels.
 * 

* The only mode supported now is "non reentrant" locks for "nodes". * * @author Katia Aresti, [email protected] * @see Infinispan documentation * @since 9.2 */ public class ClusteredLockConfiguration { private final OwnershipLevel ownershipLevel; // default NODE private final boolean reentrant; // default false /** * Default lock is non reentrant and the ownership level is {@link OwnershipLevel#NODE} */ public ClusteredLockConfiguration() { this.ownershipLevel = OwnershipLevel.NODE; this.reentrant = false; } /** * @return true if the lock is reentrant */ public boolean isReentrant() { return reentrant; } /** * @return the {@link OwnershipLevel} or this lock */ public OwnershipLevel getOwnershipLevel() { return ownershipLevel; } @Override public String toString() { final StringBuilder sb = new StringBuilder("ClusteredLockConfiguration{"); sb.append("ownershipLevel=").append(ownershipLevel.name()); sb.append(", reentrant=").append(reentrant); sb.append('}'); return sb.toString(); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy