Example usage for io.vertx.core Verticle init

List of usage examples for io.vertx.core Verticle init

Introduction

In this page you can find the example usage for io.vertx.core Verticle init.

Prototype

void init(Vertx vertx, Context context);

Source Link

Document

Initialise the verticle with the Vert.x instance and the context.

Usage

From source file:org.jacpfx.vertx.spring.SpringVerticleFactory.java

License:Open Source License

private Verticle createVerticle(final Class<?> clazz, ClassLoader classLoader) throws Exception {

    if (clazz.isAnnotationPresent(SpringVerticle.class)) {
        return createSpringVerticle(clazz, classLoader);
    } else if (Verticle.class.isAssignableFrom(clazz)) {
        // init a non spring verticle, but this should not happen
        final Verticle verticle = Verticle.class.cast(clazz.newInstance());
        verticle.init(vertx, vertx.getOrCreateContext());
        return verticle;
    }//from www  . j  a va  2s . c  o  m

    return null;
}