Top Description Methods
io.vertx.core.spi

public Interface VerticleFactory

Known Direct Implementers
io.vertx.core.impl.JavaVerticleFactory
Imports
io.vertx.core.Promise, .Verticle, .Vertx, java.util.concurrent.Callable

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 TypeMethod and Description
public default void
close()

Close the factory.

public void
createVerticle(String
The verticle name
verticleName
,
ClassLoader
The class loader
classLoader
,
Promise<Callable<Verticle>>
the promise to complete with the result
promise
)

Create a verticle instance.

public default void
init(Vertx
The Vert.x instance
vertx
)

Initialise the factory

public default int

Returns:

the order
order
()

The order of the factory.

public String

Returns:

The prefix for the factory, e.g. "java", or "js".
prefix
()

public static String

Returns:

The identifier without the prefix (if it had any)
removePrefix
(String
the identifier
identifer
)

Helper method to remove a prefix from an identifier string

Method Detail

closeback to summary
public default void close()

Close the factory. The implementation must release all resources.

createVerticleback to summary
public void createVerticle(String verticleName, ClassLoader classLoader, Promise<Callable<Verticle>> promise)

Create a verticle instance. If this method is likely to be slow (e.g. Ruby or JS verticles which might have to start up a language engine) then make sure it is run on a worker thread by Vertx#executeBlocking.

Parameters
verticleName:String

The verticle name

classLoader:ClassLoader

The class loader

promise:Promise<Callable<Verticle>>

the promise to complete with the result

initback to summary
public default void init(Vertx vertx)

Initialise the factory

Parameters
vertx:Vertx

The Vert.x instance

orderback to summary
public default int order()

The order of the factory. If there is more than one matching verticle they will be tried in ascending order.

Returns:int

the order

prefixback to summary
public String prefix()
Returns:String

The prefix for the factory, e.g. "java", or "js".

removePrefixback to summary
public static String removePrefix(String identifer)

Helper method to remove a prefix from an identifier string

Parameters
identifer:String

the identifier

Returns:String

The identifier without the prefix (if it had any)