Interface VerticleFactory

All Known Implementing Classes:
GroovyVerticleFactory

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 Details

    • 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 implement createVerticle2(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 by Vertx.executeBlocking(Callable, boolean).
      Parameters:
      verticleName - The verticle name
      classLoader - The class loader
      promise - 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 by Vertx.executeBlocking(Callable, boolean).
      Parameters:
      verticleName - The verticle name
      classLoader - The class loader
      promise - the promise to complete with the result