use of io.vertx.core.spi.VertxThreadFactory in project java-chassis by ServiceComb.
the class VertxUtils method init.
public static Vertx init(String name, VertxOptions vertxOptions) {
if (vertxOptions == null) {
vertxOptions = new VertxOptions();
}
boolean isDebug = ManagementFactory.getRuntimeMXBean().getInputArguments().toString().contains("jdwp");
if (isDebug) {
vertxOptions.setBlockedThreadCheckInterval(BLOCKED_THREAD_CHECK_INTERVAL);
LOGGER.info("in debug mode, disable blocked thread check.");
}
configureVertxFileCaching(vertxOptions);
return new VertxBuilder(vertxOptions).threadFactory(new VertxThreadFactory() {
@Override
public VertxThread newVertxThread(Runnable target, String threadName, boolean worker, long maxExecTime, TimeUnit maxExecTimeUnit) {
return VertxThreadFactory.super.newVertxThread(target, name + "-" + threadName, worker, maxExecTime, maxExecTimeUnit);
}
}).init().vertx();
}
Aggregations