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

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

There is a newer version: 15.1.1.Final
Show newest version
package org.infinispan.lock.configuration;

import org.infinispan.commons.configuration.attributes.AttributeDefinition;
import org.infinispan.commons.configuration.attributes.AttributeSet;
import org.infinispan.commons.logging.LogFactory;
import org.infinispan.lock.logging.Log;

/**
 * {@link org.infinispan.lock.api.ClusteredLock} configuration.
 *
 * @author Katia Aresti, [email protected]
 * @since 9.4
 */
public class ClusteredLockConfiguration {

   private static final Log log = LogFactory.getLog(ClusteredLockConfiguration.class, Log.class);
   static final AttributeDefinition NAME = AttributeDefinition.builder(Attribute.NAME, null, String.class)
         .validator(value -> {
            if (value == null) {
               throw log.missingName();
            }
         })
         .immutable()
         .build();

   final AttributeSet attributes;

   ClusteredLockConfiguration(AttributeSet attributes) {
      this.attributes = attributes;
   }

   static AttributeSet attributeDefinitionSet() {
      return new AttributeSet(ClusteredLockConfiguration.class, NAME);
   }

   final AttributeSet attributes() {
      return attributes;
   }

   public String name() {
      return attributes.attribute(NAME).get();
   }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy