Search in sources :

Example 1 with Annal

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);
}
Also used : Annal(io.vertx.up.log.Annal)

Example 2 with Annal

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());
}
Also used : Annal(io.vertx.up.log.Annal)

Example 3 with Annal

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);
}
Also used : JsonObject(io.vertx.core.json.JsonObject) Annal(io.vertx.up.log.Annal)

Example 4 with Annal

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);
}
Also used : JsonObject(io.vertx.core.json.JsonObject) Annal(io.vertx.up.log.Annal)

Example 5 with Annal

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;
}
Also used : Annal(io.vertx.up.log.Annal)

Aggregations

Annal (io.vertx.up.log.Annal)8 JsonObject (io.vertx.core.json.JsonObject)3 io.vertx.up.exception._400QueryKeyTypeException (io.vertx.up.exception._400QueryKeyTypeException)1