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

org.infinispan.counter.configuration.WeakCounterConfigurationBuilder Maven / Gradle / Ivy

There is a newer version: 15.1.0.Dev05
Show newest version
package org.infinispan.counter.configuration;

import org.infinispan.commons.configuration.Builder;
import org.infinispan.commons.configuration.attributes.AttributeSet;
import org.infinispan.commons.configuration.elements.ElementDefinition;

/**
 * {@link org.infinispan.counter.api.WeakCounter} configuration builder.
 *
 * @author Pedro Ruivo
 * @since 9.0
 */
public class WeakCounterConfigurationBuilder extends
      AbstractCounterConfigurationBuilder {

   public WeakCounterConfigurationBuilder(CounterManagerConfigurationBuilder builder) {
      super(builder, WeakCounterConfiguration.attributeDefinitionSet());
   }

   @Override
   public WeakCounterConfiguration create() {
      return new WeakCounterConfiguration(attributes);
   }

   @Override
   public Builder read(WeakCounterConfiguration template) {
      attributes.read(template.attributes());
      return this;
   }

   @Override
   public WeakCounterConfigurationBuilder self() {
      return this;
   }

   /**
    * Sets the counter's concurrency level.
    * 

* It sets the number of concurrent updates in the counter. A higher value will support a higher number of updates * but it increases the read of the counter's value. *

* Default value is 16. * * @param level the new concurrency level. */ public WeakCounterConfigurationBuilder concurrencyLevel(int level) { attributes.attribute(WeakCounterConfiguration.CONCURRENCY_LEVEL).set(level); return self(); } @Override public ElementDefinition getElementDefinition() { return WeakCounterConfiguration.ELEMENT_DEFINITION; } @Override public AttributeSet attributes() { return attributes; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy