public static <C extends ConnectionBase> VertxHandler<C> create(C connection) { return create(connection.context, ctx -> connection); }
private void init() { channel.pipeline().addLast("handler", VertxHandler.create(context, this::createConnection)); }
chctx.pipeline().replace("handler", "handler", VertxHandler.create(socket));
private void connected(ContextInternal context, Channel ch, Handler<AsyncResult<NetSocket>> connectHandler, SocketAddress remoteAddress) { initChannel(ch.pipeline()); VertxHandler<NetSocketImpl> handler = VertxHandler.create(context, ctx -> new NetSocketImpl(vertx, ctx, remoteAddress, context, sslHelper, metrics)); handler.addHandler(sock -> { socketMap.put(ch, sock); context.executeFromIO(v -> { if (metrics != null) { sock.metric(metrics.connected(sock.remoteAddress(), sock.remoteName())); } sock.registerEventBusHandler(); connectHandler.handle(Future.succeededFuture(sock)); }); }); handler.removeHandler(conn -> { socketMap.remove(ch); }); ch.pipeline().addLast("handler", handler); }
private void connected(HandlerHolder<Handlers> handler, Channel ch) { NetServerImpl.this.initChannel(ch.pipeline()); VertxHandler<NetSocketImpl> nh = VertxHandler.<NetSocketImpl>create(handler.context, ctx -> new NetSocketImpl(vertx, ctx, handler.context, sslHelper, metrics)); nh.addHandler(conn -> socketMap.put(ch, conn)); nh.removeHandler(conn -> socketMap.remove(ch)); ch.pipeline().addLast("handler", nh); NetSocketImpl sock = nh.getConnection(); handler.context.executeFromIO(v -> { if (metrics != null) { sock.metric(metrics.connected(sock.remoteAddress(), sock.remoteName())); } sock.registerEventBusHandler(); handler.handler.connectionHandler.handle(sock); }); }
pipeline.remove(inflater); pipeline.replace("handler", "handler", VertxHandler.create(socket));
Future<ConnectResult<HttpClientConnection>> future) { boolean upgrade = version == HttpVersion.HTTP_2 && options.isHttp2ClearTextUpgrade(); VertxHandler<Http1xClientConnection> clientHandler = VertxHandler.create(context, chctx -> { Http1xClientConnection conn = new Http1xClientConnection(listener, upgrade ? HttpVersion.HTTP_1_1 : version, client, endpointMetric, chctx, ssl, host, port, context, metrics); if (metrics != null) {
VertxHandler<Http1xServerConnection> handler = VertxHandler.create(holder2.context, chctx -> { Http1xServerConnection conn = new Http1xServerConnection(holder2.context.owner(), sslHelper,
public static <C extends ConnectionBase> VertxHandler<C> create(C connection) { return create(connection.context, ctx -> connection); }
}; HandlerHolder<HttpHandlers> holder = new HandlerHolder<>(context, new HttpHandlers(null, app, null, null, null)); VertxHandler<Http1xServerConnection> handler = VertxHandler.create(holder.context, chctx -> new Http1xServerConnection( holder.context.owner(), null,
private void init() { channel.pipeline().addLast("handler", VertxHandler.create(context, this::createConnection)); }
chctx.pipeline().replace("handler", "handler", VertxHandler.create(socket));
private void connected(ContextInternal context, Channel ch, Handler<AsyncResult<NetSocket>> connectHandler, SocketAddress remoteAddress) { initChannel(ch.pipeline()); VertxHandler<NetSocketImpl> handler = VertxHandler.create(context, ctx -> new NetSocketImpl(vertx, ctx, remoteAddress, context, sslHelper, metrics)); handler.addHandler(sock -> { socketMap.put(ch, sock); context.executeFromIO(v -> { if (metrics != null) { sock.metric(metrics.connected(sock.remoteAddress(), sock.remoteName())); } sock.registerEventBusHandler(); connectHandler.handle(Future.succeededFuture(sock)); }); }); handler.removeHandler(conn -> { socketMap.remove(ch); }); ch.pipeline().addLast("handler", handler); }
private void connected(HandlerHolder<Handlers> handler, Channel ch) { NetServerImpl.this.initChannel(ch.pipeline()); VertxHandler<NetSocketImpl> nh = VertxHandler.<NetSocketImpl>create(handler.context, ctx -> new NetSocketImpl(vertx, ctx, handler.context, sslHelper, metrics)); nh.addHandler(conn -> socketMap.put(ch, conn)); nh.removeHandler(conn -> socketMap.remove(ch)); ch.pipeline().addLast("handler", nh); NetSocketImpl sock = nh.getConnection(); handler.context.executeFromIO(v -> { if (metrics != null) { sock.metric(metrics.connected(sock.remoteAddress(), sock.remoteName())); } sock.registerEventBusHandler(); handler.handler.connectionHandler.handle(sock); }); }
pipeline.remove(inflater); pipeline.replace("handler", "handler", VertxHandler.create(socket));
Future<ConnectResult<HttpClientConnection>> future) { boolean upgrade = version == HttpVersion.HTTP_2 && options.isHttp2ClearTextUpgrade(); VertxHandler<Http1xClientConnection> clientHandler = VertxHandler.create(context, chctx -> { Http1xClientConnection conn = new Http1xClientConnection(listener, upgrade ? HttpVersion.HTTP_1_1 : version, client, endpointMetric, chctx, ssl, host, port, context, metrics); if (metrics != null) {
VertxHandler<Http1xServerConnection> handler = VertxHandler.create(holder2.context, chctx -> { Http1xServerConnection conn = new Http1xServerConnection(holder2.context.owner(), sslHelper,
}; HandlerHolder<HttpHandlers> holder = new HandlerHolder<>(context, new HttpHandlers(null, app, null, null, null)); VertxHandler<Http1xServerConnection> handler = VertxHandler.create(holder.context, chctx -> new Http1xServerConnection( holder.context.owner(), null,