List of usage examples for io.vertx.core.impl.verticle CompilingClassLoader CompilingClassLoader
public CompilingClassLoader(ClassLoader loader, String sourceName)
From source file:com.englishtown.vertx.guice.GuiceVerticleLoader.java
License:Open Source License
public Verticle createRealVerticle() throws Exception { String className = verticleName; Class<?> clazz;//from w ww . ja va 2 s. c o m 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; }
From source file:com.jiabangou.ninja.vertx.standalone.guice.GuiceVerticleLoader.java
License:Open Source License
public Verticle createRealVerticle() throws Exception { String className = verticleName; Class<?> clazz;/* w w w .j a v a2 s .c o m*/ 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); }
From source file:org.apache.tamaya.vertx.ConfiguredVerticleFactory.java
License:Apache License
@Override public Verticle createVerticle(String verticleName, ClassLoader classLoader) throws Exception { verticleName = VerticleFactory.removePrefix(verticleName); Class clazz;/*from ww w .java 2 s . c o m*/ 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.getConstructor().newInstance(); ConfigurationInjector.getInstance(classLoader).configure(instance); return instance; }
From source file:org.jacpfx.vertx.spring.SpringVerticleFactory.java
License:Open Source License
@Override public synchronized Verticle createVerticle(final String verticleName, final ClassLoader classLoader) throws Exception { final String className = VerticleFactory.removePrefix(verticleName); Class<?> clazz;//w w w.j av a2s .c o m if (className.endsWith(SUFFIX)) { CompilingClassLoader compilingLoader = new CompilingClassLoader(classLoader, className); clazz = compilingLoader.loadClass(compilingLoader.resolveMainClassName()); } else { clazz = classLoader.loadClass(className); } return createVerticle(clazz, classLoader); }