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

org.infinispan.counter.impl.manager.VolatileCounterConfigurationStorage Maven / Gradle / Ivy

There is a newer version: 15.1.0.Dev03
Show newest version
package org.infinispan.counter.impl.manager;

import static org.infinispan.counter.logging.Log.CONTAINER;

import java.util.Collections;
import java.util.Map;

import org.infinispan.counter.api.CounterConfiguration;
import org.infinispan.counter.api.Storage;
import org.infinispan.factories.scopes.Scope;
import org.infinispan.factories.scopes.Scopes;

/**
 * A volatile implementation of {@link CounterConfigurationStorage}.
 * 

* It throws an exception if it tries to store a {@link Storage#PERSISTENT} counter. * * @author Pedro Ruivo * @since 9.2 */ @Scope(Scopes.GLOBAL) public enum VolatileCounterConfigurationStorage implements CounterConfigurationStorage { INSTANCE; @Override public Map loadAll() { return Collections.emptyMap(); } @Override public void store(String name, CounterConfiguration configuration) { } @Override public void remove(String name) { } @Override public void validatePersistence(CounterConfiguration configuration) { if (configuration.storage() == Storage.PERSISTENT) { throw CONTAINER.invalidPersistentStorageMode(); } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy