Example usage for io.vertx.core Context put

List of usage examples for io.vertx.core Context put

Introduction

In this page you can find the example usage for io.vertx.core Context put.

Prototype

void put(String key, Object value);

Source Link

Document

Put some data in the context.

Usage

From source file:examples.CoreExamples.java

License:Open Source License

public void runInContextWithData(Vertx vertx) {
    final Context context = vertx.getOrCreateContext();
    context.put("data", "hello");
    context.runOnContext((v) -> {/*from   ww w  . ja v a 2 s  . co m*/
        String hello = context.get("data");
    });
}

From source file:org.apache.servicecomb.foundation.vertx.client.ClientPoolManager.java

License:Apache License

protected void addPool(Context context, CLIENT_POOL pool) {
    context.put(id, pool);
    pools.add(pool);
}