/** * {@inheritDoc} */ @Override public Verticle createVerticle(String main) throws Exception { Verticle verticle = new HK2VerticleLoader(main, cl); verticle.setVertx(vertx); verticle.setContainer(container); return verticle; }
public Verticle createVerticle(String main) throws Exception { String className = main; Class<?> clazz; if (isJavaSource(main)) { // TODO - is this right??? // Don't we want one CompilingClassloader per instance of this? CompilingClassLoader compilingLoader = new CompilingClassLoader(cl, main); className = compilingLoader.resolveMainClassName(); clazz = compilingLoader.loadClass(className); } else { clazz = cl.loadClass(className); } Verticle verticle = (Verticle)clazz.newInstance(); verticle.setVertx(vertx); verticle.setContainer(container); return verticle; }
public Verticle createRealVerticle() throws Exception { String className = main; Class<?> clazz; if (isJavaSource(main)) { // TODO - is this right??? // Don't we want one CompilingClassLoader per instance of this? CompilingClassLoader compilingLoader = new CompilingClassLoader(cl, main); className = compilingLoader.resolveMainClassName(); clazz = compilingLoader.loadClass(className); } else { clazz = cl.loadClass(className); } Verticle verticle = createRealVerticle(clazz); verticle.setVertx(vertx); verticle.setContainer(container); return verticle; }