use of io.vertx.core.Verticle in project vert.x by eclipse.
the class JavaVerticleFactory method createVerticle.
@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);
}
return (Verticle) clazz.newInstance();
}
Aggregations