io.quarkus.cache.runtime.noop.NoOpCache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-cache Show documentation
Show all versions of quarkus-cache Show documentation
Enable application data caching in CDI beans
package io.quarkus.cache.runtime.noop;
import java.util.function.Function;
import java.util.function.Supplier;
import io.quarkus.cache.runtime.AbstractCache;
import io.smallrye.mutiny.Uni;
/**
* This class is an internal Quarkus cache implementation. Do not use it explicitly from your Quarkus application. The public
* methods signatures may change without prior notice.
*/
public class NoOpCache extends AbstractCache {
private static final String NAME = NoOpCache.class.getName();
@Override
public String getName() {
return NAME;
}
@Override
public Uni get(K key, Function valueLoader) {
return Uni.createFrom().item(new Supplier() {
@Override
public V get() {
return valueLoader.apply(key);
}
});
}
@Override
public Uni invalidate(Object key) {
return Uni.createFrom().voidItem();
}
@Override
public Uni invalidateAll() {
return Uni.createFrom().voidItem();
}
@Override
public Uni replaceUniValue(Object key, Object emittedValue) {
return Uni.createFrom().voidItem();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy