use of io.vertx.up.log.Annal in project vertx-zero by silentbalanceyh.
the class InvokerUtil method verifyArgs.
/**
* Arguments verification
*
* @param method
* @param target
*/
static void verifyArgs(final Method method, final Class<?> target) {
// 1. Ensure method length
final Class<?>[] params = method.getParameterTypes();
final Annal logger = Annal.get(target);
// 2. The parameters
Fn.flingUp(Values.ONE != params.length, logger, WorkerArgumentException.class, target, method);
}
use of io.vertx.up.log.Annal in project vertx-zero by silentbalanceyh.
the class InvokerUtil method verify.
static void verify(final boolean condition, final Class<?> returnType, final Class<?> paramType, final Class<?> target) {
final Annal logger = Annal.get(target);
Fn.flingUp(condition, logger, AsyncSignatureException.class, target, returnType.getName(), paramType.getName());
}
use of io.vertx.up.log.Annal in project vertx-zero by silentbalanceyh.
the class Infix method init.
static <R> R init(final String key, final Function<JsonObject, R> executor, final Class<?> clazz) {
final Annal logger = Annal.get(clazz);
final JsonObject options = init(logger, key, clazz);
final JsonObject config = null == options.getJsonObject(key) ? new JsonObject() : options.getJsonObject(key);
return init(logger, key, config, executor);
}
use of io.vertx.up.log.Annal in project vertx-zero by silentbalanceyh.
the class Infix method initTp.
static <R> R initTp(final String key, final Function<JsonObject, R> executor, final Class<?> clazz) {
final Annal logger = Annal.get(clazz);
final JsonObject options = init(logger, key, clazz);
final JsonObject config = null == options.getJsonObject(key) ? new JsonObject() : options.getJsonObject(key);
final JsonObject ready = config.containsKey("config") ? config.getJsonObject("config") : new JsonObject();
return init(logger, key, ready, executor);
}
use of io.vertx.up.log.Annal in project vertx-zero by silentbalanceyh.
the class Debug method timer.
static <T> T timer(final Class<?> clazz, final Supplier<T> supplier) {
final long start = System.nanoTime();
final T ret = supplier.get();
final long end = System.nanoTime();
final Annal LOGGER = Annal.get(clazz);
LOGGER.info("[ ZERO ] Time spend and Get: {0}ns", String.valueOf(end - start));
return ret;
}
Aggregations