@Override public Connection newConnection(Connector connector, EndPoint endPoint) { final Connection connection = connectionFactory.newConnection(connector, endPoint); connection.addListener(new Connection.Listener() { @Nullable private Timer.Context context; @Override public void onOpened(Connection connection) { this.context = timer.time(); } @Override public void onClosed(Connection connection) { requireNonNull(context).stop(); } }); return connection; } }
@Override public Connection newConnection(Connector connector, EndPoint endPoint) { final Connection connection = connectionFactory.newConnection(connector, endPoint); connection.addListener( new Connection.Listener() { @Override public void onOpened(Connection connection) { activeConns.incrementAndGet(); } @Override public void onClosed(Connection connection) { activeConns.decrementAndGet(); } } ); return connection; } }
@Override public Connection newConnection(SocketChannel channel, EndPoint endpoint, Object attachment) throws IOException { return getDefaultConnectionFactory().newConnection(ServerConnector.this, endpoint); }
@Override public Connection newConnection(SelectableChannel channel, EndPoint endpoint, Object attachment) throws IOException { return getDefaultConnectionFactory().newConnection(UnixSocketConnector.this, endpoint); }
@Override public Connection newConnection(SocketChannel channel, EndPoint endpoint, Object attachment) throws IOException { return getDefaultConnectionFactory().newConnection(ServerConnector.this, endpoint); }
@Override public Connection newConnection(SocketChannel channel, EndPoint endpoint, Object attachment) throws IOException { return getDefaultConnectionFactory().newConnection(ServerConnector.this, endpoint); }
@Override public Connection newConnection(SocketChannel channel, EndPoint endpoint, Object attachment) throws IOException { return getDefaultConnectionFactory().newConnection(ServerConnector.this, endpoint); }
@Override public Connection newConnection(SelectableChannel channel, EndPoint endpoint, Object attachment) throws IOException { return getDefaultConnectionFactory().newConnection(ServerConnector.this, endpoint); }
@Override public Connection newConnection(Connector connector, EndPoint endPoint) { final Connection connection = connectionFactory.newConnection(connector, endPoint); connection.addListener(new Connection.Listener() { private Timer.Context context; @Override public void onOpened(Connection connection) { this.context = timer.time(); } @Override public void onClosed(Connection connection) { context.stop(); } }); return connection; } }
@Override public Connection newConnection(Connector connector, EndPoint endPoint) { // Allow the wrapper to build its connection, then add our own listener to it. This listener will update the metric for our active connection count. final Connection connection = _wrappedConnectionFactory.newConnection(connector, endPoint); connection.addListener(new Connection.Listener() { @Override public void onOpened(Connection connection) { _activeConnectionCounter.inc(); } @Override public void onClosed(Connection connection) { _activeConnectionCounter.dec(); } }); return connection; } }
@Override protected void accept(int acceptorID) throws IOException, InterruptedException { LOG.debug("accepting {}", acceptorID); LocalEndPoint endPoint = _connects.take(); endPoint.onOpen(); onEndPointOpened(endPoint); Connection connection = getDefaultConnectionFactory().newConnection(this, endPoint); endPoint.setConnection(connection); // connectionOpened(connection); connection.onOpen(); }
@Override protected void accept(int acceptorID) throws IOException, InterruptedException { LOG.debug("accepting {}", acceptorID); LocalEndPoint endPoint = _connects.take(); endPoint.onOpen(); onEndPointOpened(endPoint); Connection connection = getDefaultConnectionFactory().newConnection(this, endPoint); endPoint.setConnection(connection); // connectionOpened(connection); connection.onOpen(); }
@Override protected void accept(int acceptorID) throws IOException, InterruptedException { if (LOG.isDebugEnabled()) LOG.debug("accepting {}", acceptorID); LocalEndPoint endPoint = _connects.take(); endPoint.onOpen(); onEndPointOpened(endPoint); Connection connection = getDefaultConnectionFactory().newConnection(this, endPoint); endPoint.setConnection(connection); connection.onOpen(); }
@Override protected void accept(int acceptorID) throws IOException, InterruptedException { if (LOG.isDebugEnabled()) LOG.debug("accepting {}", acceptorID); LocalEndPoint endPoint = _connects.take(); endPoint.onOpen(); onEndPointOpened(endPoint); Connection connection = getDefaultConnectionFactory().newConnection(this, endPoint); endPoint.setConnection(connection); connection.onOpen(); }
@Override protected void accept(int acceptorID) throws IOException, InterruptedException { if (LOG.isDebugEnabled()) LOG.debug("accepting {}", acceptorID); LocalEndPoint endPoint = _connects.take(); Connection connection = getDefaultConnectionFactory().newConnection(this, endPoint); endPoint.setConnection(connection); endPoint.onOpen(); onEndPointOpened(endPoint); connection.onOpen(); }
@Override public Connection newConnection(Connector connector, EndPoint endPoint) { SSLEngine engine = _sslContextFactory.newSSLEngine(endPoint.getRemoteAddress()); engine.setUseClientMode(false); SslConnection sslConnection = newSslConnection(connector, endPoint, engine); configure(sslConnection, connector, endPoint); ConnectionFactory next = connector.getConnectionFactory(_nextProtocol); EndPoint decryptedEndPoint = sslConnection.getDecryptedEndPoint(); Connection connection = next.newConnection(connector, decryptedEndPoint); decryptedEndPoint.setConnection(connection); return sslConnection; }
@Override public Connection newConnection(Connector connector, EndPoint endPoint) { SSLEngine engine = _sslContextFactory.newSSLEngine(endPoint.getRemoteAddress()); engine.setUseClientMode(false); SslConnection sslConnection = newSslConnection(connector, endPoint, engine); configure(sslConnection, connector, endPoint); ConnectionFactory next = connector.getConnectionFactory(_nextProtocol); EndPoint decryptedEndPoint = sslConnection.getDecryptedEndPoint(); Connection connection = next.newConnection(connector, decryptedEndPoint); decryptedEndPoint.setConnection(connection); return sslConnection; }
@Override public Connection newConnection(Connector connector, EndPoint endPoint) { SSLEngine engine = _sslContextFactory.newSSLEngine(endPoint.getRemoteAddress()); engine.setUseClientMode(false); SslConnection sslConnection = newSslConnection(connector, endPoint, engine); sslConnection.setRenegotiationAllowed(_sslContextFactory.isRenegotiationAllowed()); configure(sslConnection, connector, endPoint); ConnectionFactory next = connector.getConnectionFactory(_nextProtocol); EndPoint decryptedEndPoint = sslConnection.getDecryptedEndPoint(); Connection connection = next.newConnection(connector, decryptedEndPoint); decryptedEndPoint.setConnection(connection); return sslConnection; }
@Override public Connection newConnection(Connector connector, EndPoint endPoint) { SSLEngine engine = _sslContextFactory.newSSLEngine(endPoint.getRemoteAddress()); engine.setUseClientMode(false); SslConnection sslConnection = newSslConnection(connector, endPoint, engine); sslConnection.setRenegotiationAllowed(_sslContextFactory.isRenegotiationAllowed()); configure(sslConnection, connector, endPoint); ConnectionFactory next = connector.getConnectionFactory(_nextProtocol); EndPoint decryptedEndPoint = sslConnection.getDecryptedEndPoint(); Connection connection = next.newConnection(connector, decryptedEndPoint); decryptedEndPoint.setConnection(connection); return sslConnection; }
@Override public Connection newConnection(Connector connector, EndPoint endPoint) { SSLEngine engine = _sslContextFactory.newSSLEngine(endPoint.getRemoteAddress()); engine.setUseClientMode(false); SslConnection sslConnection = newSslConnection(connector, endPoint, engine); sslConnection.setRenegotiationAllowed(_sslContextFactory.isRenegotiationAllowed()); sslConnection.setRenegotiationLimit(_sslContextFactory.getRenegotiationLimit()); configure(sslConnection, connector, endPoint); ConnectionFactory next = connector.getConnectionFactory(_nextProtocol); EndPoint decryptedEndPoint = sslConnection.getDecryptedEndPoint(); Connection connection = next.newConnection(connector, decryptedEndPoint); decryptedEndPoint.setConnection(connection); return sslConnection; }