public interface VerticleFactory
Has 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
Modifier and TypeMethodDescriptiondefault voidclose()Close the factory.default voidcreateVerticle(String verticleName, ClassLoader classLoader, Promise<Callable<Verticle>> promise) Deprecated.default voidcreateVerticle2(String verticleName, ClassLoader classLoader, Promise<Callable<? extends Deployable>> promise) Create a verticle instance.default voidInitialise the factorydefault intorder()The order of the factory.prefix()static StringremovePrefix(String identifer) Helper method to remove a prefix from an identifier string
-
Method Details
-
removePrefix
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
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
-
createVerticle2(String, ClassLoader, Promise)