Package io.vertx.core.spi
Interface VerticleFactory
-
- All Known Implementing Classes:
GroovyVerticleFactory
public interface VerticleFactoryHas responsibility for creating verticle instances.Implementations of this are responsible for creating verticle written in various different JVM languages and for other purposes.
- Author:
- Tim Fox
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default voidclose()Close the factory.default voidcreateVerticle(String verticleName, ClassLoader classLoader, Promise<Callable<Verticle>> promise)Deprecated.deprecated, instead implementcreateVerticle2(String, ClassLoader, Promise)default voidcreateVerticle2(String verticleName, ClassLoader classLoader, Promise<Callable<? extends Deployable>> promise)Create a verticle instance.default voidinit(Vertx vertx)Initialise the factorydefault intorder()The order of the factory.Stringprefix()static StringremovePrefix(String identifer)Helper method to remove a prefix from an identifier string
-
-
-
Method Detail
-
removePrefix
static String removePrefix(String identifer)
Helper method to remove a prefix from an identifier string- Parameters:
identifer- the identifier- Returns:
- The identifier without the prefix (if it had any)
-
order
default int order()
The order of the factory. If there is more than one matching verticle they will be tried in ascending order.- Returns:
- the order
-
init
default void init(Vertx vertx)
Initialise the factory- Parameters:
vertx- The Vert.x instance
-
close
default void close()
Close the factory. The implementation must release all resources.
-
prefix
String prefix()
- Returns:
- The prefix for the factory, e.g. "java", or "js".
-
createVerticle
@Deprecated default void createVerticle(String verticleName, ClassLoader classLoader, Promise<Callable<Verticle>> promise)
Deprecated.deprecated, instead implementcreateVerticle2(String, ClassLoader, Promise)Create a verticle instance. If this method is likely to be slow then make sure it is run on a worker thread byVertx.executeBlocking(java.util.concurrent.Callable<T>, boolean).- Parameters:
verticleName- The verticle nameclassLoader- The class loaderpromise- the promise to complete with the result
-
createVerticle2
default void createVerticle2(String verticleName, ClassLoader classLoader, Promise<Callable<? extends Deployable>> promise)
Create a verticle instance. If this method is likely to be slow then make sure it is run on a worker thread byVertx.executeBlocking(java.util.concurrent.Callable<T>, boolean).- Parameters:
verticleName- The verticle nameclassLoader- The class loaderpromise- the promise to complete with the result
-
-