@Override public Verticle createVerticle(String verticleName, ClassLoader classLoader) throws Exception { verticleName = VerticleFactory.removePrefix(verticleName); Class clazz; if (verticleName.endsWith(".java")) { CompilingClassLoader compilingLoader = new CompilingClassLoader(classLoader, verticleName); String className = compilingLoader.resolveMainClassName(); clazz = compilingLoader.loadClass(className); } else { clazz = classLoader.loadClass(verticleName); } Verticle instance = (Verticle)clazz.newInstance(); ConfigurationInjection.getConfigurationInjector().configure(instance); return instance; }
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); } return createRealVerticle(clazz); }
@Override public synchronized Verticle createVerticle(final String verticleName, final ClassLoader classLoader) throws Exception { final String className = VerticleFactory.removePrefix(verticleName); Class<?> clazz; if (className.endsWith(SUFFIX)) { CompilingClassLoader compilingLoader = new CompilingClassLoader(classLoader, className); clazz = compilingLoader.loadClass(compilingLoader.resolveMainClassName()); } else { clazz = classLoader.loadClass(className); } return createVerticle(clazz, classLoader); }