public Verticle createRealVerticle() throws Exception { String className = verticleName; Class<?> clazz; if (className.endsWith(".java")) { CompilingClassLoader compilingLoader = new CompilingClassLoader(classLoader, className); className = compilingLoader.resolveMainClassName(); clazz = compilingLoader.loadClass(className); } else { clazz = classLoader.loadClass(className); } Verticle verticle = createRealVerticle(clazz); return verticle; }
private Verticle createRealVerticle(Class<?> clazz) throws Exception { JsonObject config = config(); Object field = config.getValue(CONFIG_BOOTSTRAP_BINDER_NAME); JsonArray bootstrapNames;
private Verticle createRealVerticle(Class<?> clazz) throws Exception { JsonObject config = config(); Object field = config.getValue(CONFIG_BOOTSTRAP_BINDER_NAME); JsonArray bootstrapNames;
public Verticle createRealVerticle() throws Exception { String className = verticleName; Class<?> clazz; if (className.endsWith(".java")) { CompilingClassLoader compilingLoader = new CompilingClassLoader(classLoader, className); className = compilingLoader.resolveMainClassName(); clazz = compilingLoader.loadClass(className); } else { clazz = classLoader.loadClass(className); } Verticle verticle = createRealVerticle(clazz); return verticle; }
/** * Initialise the verticle.<p> * This is called by Vert.x when the verticle instance is deployed. Don't call it yourself. * * @param vertx the deploying Vert.x instance * @param context the context of the verticle */ @Override public void init(Vertx vertx, Context context) { super.init(vertx, context); try { // Create the real verticle and init realVerticle = createRealVerticle(); realVerticle.init(vertx, context); } catch (Throwable t) { if (t instanceof RuntimeException) { throw (RuntimeException) t; } throw new RuntimeException(t); } }
/** * Initialise the verticle.<p> * This is called by Vert.x when the verticle instance is deployed. Don't call it yourself. * * @param vertx the deploying Vert.x instance * @param context the context of the verticle */ @Override public void init(Vertx vertx, Context context) { super.init(vertx, context); try { // Create the real verticle and init realVerticle = createRealVerticle(); realVerticle.init(vertx, context); } catch (Throwable t) { if (t instanceof RuntimeException) { throw (RuntimeException) t; } throw new RuntimeException(t); } }