/** * Create a inet socket address, {@code host} must be non {@code null} and {@code port} must be between {@code 0} * and {@code 65536}. * * @param port the address port * @param host the address host * @return the created socket address */ static SocketAddress inetSocketAddress(int port, String host) { return new SocketAddressImpl(port, host); }
@Override public String toString() { return nodeId + ":" + serverID.toString(); } }
/** * Create and return the trust manager factory for these options. * <p> * The returned trust manager factory should be already initialized and ready to use. * * @param vertx the vertx instance * @return the trust manager factory */ default TrustManagerFactory getTrustManagerFactory(Vertx vertx) throws Exception { return KeyStoreHelper.create((VertxInternal) vertx, this).getTrustMgrFactory((VertxInternal) vertx); }
/** * Create and return the key manager factory for these options. * <p> * The returned key manager factory should be already initialized and ready to use. * * @param vertx the vertx instance * @return the key manager factory */ default KeyManagerFactory getKeyManagerFactory(Vertx vertx) throws Exception { return KeyStoreHelper.create((VertxInternal) vertx, this).getKeyMgrFactory(); }
public synchronized void validate(VertxInternal vertx) { if (ssl) { getContext(vertx, null); } }
private EventLoopHolder findHolder(EventLoop worker) { EventLoopHolder wh = new EventLoopHolder(worker); for (EventLoopHolder holder : workers) { if (holder.equals(wh)) { return holder; } } return null; }
@Override protected synchronized void handleInterestedOpsChanged() { checkContext(); callDrainHandler(); }
@Override public void handleClosed() { synchronized (this) { closed = true; } super.handleClosed(); }
@Override public void channelWritabilityChanged(ChannelHandlerContext ctx) throws Exception { C conn = getConnection(); context.executeFromIO(v -> conn.handleInterestedOpsChanged()); }
/** * Create a new {@code SelfSignedCertificate} instance. * * @return a new instance. */ static SelfSignedCertificate create() { return new SelfSignedCertificateImpl(); }
@Override public synchronized NetSocket handler(Handler<Buffer> dataHandler) { return super.handler(dataHandler); } @Override
/** * Create a new {@link io.netty.channel.ChannelHandlerContext} which wraps the given one anf force the usage of direct buffers. */ public static ChannelHandlerContext forceDirectAllocator(ChannelHandlerContext ctx) { return new PooledChannelHandlerContext(ctx); }
@Override public NetServer listen() { listen((Handler<AsyncResult<NetServer>>) null); return this; }
final void handleRead(Object msg) { synchronized (this) { read = true; } handleMessage(msg); }
@Override public NetSocketStream handler(Handler<NetSocket> handler) { connectHandler(handler); return this; }
@Override public NetSocket setWriteQueueMaxSize(int maxSize) { doSetWriteQueueMaxSize(maxSize); return this; }
@Override public NetClient connect(SocketAddress remoteAddress, Handler<AsyncResult<NetSocket>> connectHandler) { doConnect(remoteAddress, null, connectHandler); return this; }
/** * Create a domain socket address. * * @param path the address path * @return the created socket address */ static SocketAddress domainSocketAddress(String path) { return new SocketAddressImpl(path); }
/** * Create a new {@code SelfSignedCertificate} instance with a fully-qualified domain name, * * @param fqdn a fully qualified domain name. * @return a new instance. */ static SelfSignedCertificate create(String fqdn) { return new SelfSignedCertificateImpl(fqdn); } }