io.vertx.tp.plugin.shared.MapInfix Maven / Gradle / Ivy
package io.vertx.tp.plugin.shared;
import io.vertx.core.Vertx;
import io.vertx.up.annotations.Plugin;
import io.vertx.up.eon.Plugins;
import io.vertx.up.fn.Fn;
import io.vertx.up.plugin.Infix;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
@Plugin
@SuppressWarnings("all")
public class MapInfix implements Infix {
private static final String NAME = "ZERO_MAP_POOL";
private static final ConcurrentMap> CLIENTS
= new ConcurrentHashMap<>();
private static void initInternal(final Vertx vertx,
final String name) {
Fn.pool(CLIENTS, name,
() -> Infix.initTp(Plugins.Infix.SHARED,
(config) -> SharedClient.createShared(vertx, config, name),
MapInfix.class));
}
public static void init(final Vertx vertx) {
initInternal(vertx, NAME);
}
public static SharedClient getClient() {
return CLIENTS.get(NAME);
}
public static String getDefaultName() {
return NAME;
}
@Override
public SharedClient get() {
return getClient();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy