io.vertx.tp.plugin.ali.SmsInfix Maven / Gradle / Ivy
The newest version!
package io.vertx.tp.plugin.ali;
import io.vertx.core.Vertx;
import io.vertx.tp.plugin.ali.sms.SmsClient;
import io.vertx.up.annotations.Plugin;
import io.vertx.up.plugin.Infix;
import io.horizon.uca.cache.Cc;
@Plugin
@SuppressWarnings("all")
public class SmsInfix implements Infix {
private static final String NAME = "ZERO_ALI_SMS_POOL";
private static final Cc CC_CLIENT = Cc.open();
private static void initInternal(final Vertx vertx,
final String name) {
CC_CLIENT.pick(() -> Infix.init("ali-sms",
(config) -> SmsClient.createShared(vertx),
SmsInfix.class), name);
}
public static void init(final Vertx vertx) {
initInternal(vertx, NAME);
}
public static SmsClient getClient() {
return CC_CLIENT.store(NAME);
}
@Override
public SmsClient get() {
return getClient();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy