private VerticleHolder getVerticleHolder() { Context context = vertx.getContext(); if (context != null) { VerticleHolder holder = (VerticleHolder) context.getDeploymentHandle(); return holder; } else { return null; } }
// Must be synchronized since called directly from different thread private void addVerticle(Deployment deployment, Verticle verticle, VerticleFactory factory) { String loggerName = "org.vertx.deployments." + deployment.name + "-" + deployment.verticles.size(); Logger logger = LoggerFactory.getLogger(loggerName); Context context = vertx.getContext(); VerticleHolder holder = new VerticleHolder( deployment, context, verticle, loggerName, logger, deployment.config, factory); deployment.verticles.add(holder); context.setDeploymentHandle(holder); }