@Override public void setConnection(final Connection connection) { _underlying.setConnection(connection); }
@Override public void setConnection(Connection connection) { _endp.setConnection(connection); }
public void setConnection(Connection connection) { _endp.setConnection(connection); }
@Override public org.eclipse.jetty.io.Connection newConnection(EndPoint endPoint, Map<String, Object> context) throws IOException { String host = (String)context.get(SSL_PEER_HOST_CONTEXT_KEY); int port = (Integer)context.get(SSL_PEER_PORT_CONTEXT_KEY); SSLEngine engine = sslContextFactory.newSSLEngine(host, port); engine.setUseClientMode(true); context.put(SSL_ENGINE_CONTEXT_KEY, engine); SslConnection sslConnection = newSslConnection(byteBufferPool, executor, endPoint, engine); endPoint.setConnection(sslConnection); EndPoint appEndPoint = sslConnection.getDecryptedEndPoint(); appEndPoint.setConnection(connectionFactory.newConnection(appEndPoint, context)); customize(sslConnection, context); return sslConnection; }
@Override public org.eclipse.jetty.io.Connection newConnection(EndPoint endPoint, Map<String, Object> context) throws IOException { String host = (String)context.get(SSL_PEER_HOST_CONTEXT_KEY); int port = (Integer)context.get(SSL_PEER_PORT_CONTEXT_KEY); SSLEngine engine = sslContextFactory.newSSLEngine(host, port); engine.setUseClientMode(true); context.put(SSL_ENGINE_CONTEXT_KEY, engine); SslConnection sslConnection = newSslConnection(byteBufferPool, executor, endPoint, engine); sslConnection.setRenegotiationAllowed(sslContextFactory.isRenegotiationAllowed()); endPoint.setConnection(sslConnection); EndPoint appEndPoint = sslConnection.getDecryptedEndPoint(); appEndPoint.setConnection(connectionFactory.newConnection(appEndPoint, context)); return sslConnection; }
@Override public org.eclipse.jetty.io.Connection newConnection(EndPoint endPoint, Map<String, Object> context) throws IOException { String host = (String)context.get(SSL_PEER_HOST_CONTEXT_KEY); int port = (Integer)context.get(SSL_PEER_PORT_CONTEXT_KEY); SSLEngine engine = sslContextFactory.newSSLEngine(host, port); engine.setUseClientMode(true); context.put(SSL_ENGINE_CONTEXT_KEY, engine); SslConnection sslConnection = newSslConnection(byteBufferPool, executor, endPoint, engine); sslConnection.setRenegotiationAllowed(sslContextFactory.isRenegotiationAllowed()); endPoint.setConnection(sslConnection); EndPoint appEndPoint = sslConnection.getDecryptedEndPoint(); appEndPoint.setConnection(connectionFactory.newConnection(appEndPoint, context)); return sslConnection; }
private EndPoint createEndPoint(SocketChannel channel, SelectionKey selectionKey) throws IOException { EndPoint endPoint = _selectorManager.newEndPoint(channel, this, selectionKey); _selectorManager.endPointOpened(endPoint); Connection connection = _selectorManager.newConnection(channel, endPoint, selectionKey.attachment()); endPoint.setConnection(connection); selectionKey.attach(endPoint); _selectorManager.connectionOpened(connection); if (LOG.isDebugEnabled()) LOG.debug("Created {}", endPoint); return endPoint; }
/** * Replaces the given {@code oldConnection} with the given {@code newConnection} on the * {@link EndPoint} associated with {@code oldConnection}, performing connection lifecycle management. * <p /> * The {@code oldConnection} will be closed by invoking {@link org.eclipse.jetty.io.Connection#onClose()} * and the {@code newConnection} will be opened by invoking {@link org.eclipse.jetty.io.Connection#onOpen(ByteBuffer)}. * @param oldConnection the old connection to replace * @param newConnection the new connection replacement */ public static void replaceConnection(Connection oldConnection, Connection newConnection) { close(oldConnection); oldConnection.getEndPoint().setConnection(newConnection); open(newConnection); }
private EndPoint createEndPoint(SocketChannel channel, SelectionKey selectionKey) throws IOException { EndPoint endPoint = newEndPoint(channel, this, selectionKey); endPointOpened(endPoint); Connection connection = newConnection(channel, endPoint, selectionKey.attachment()); endPoint.setConnection(connection); connectionOpened(connection); LOG.debug("Created {}", endPoint); return endPoint; }
private EndPoint createEndPoint(SocketChannel channel, SelectionKey selectionKey) throws IOException { EndPoint endPoint = newEndPoint(channel, this, selectionKey); endPointOpened(endPoint); Connection connection = newConnection(channel, endPoint, selectionKey.attachment()); endPoint.setConnection(connection); connectionOpened(connection); LOG.debug("Created {}", endPoint); return endPoint; }
private void createEndPoint(SelectableChannel channel, SelectionKey selectionKey) throws IOException { EndPoint endPoint = _selectorManager.newEndPoint(channel, this, selectionKey); Connection connection = _selectorManager.newConnection(channel, endPoint, selectionKey.attachment()); endPoint.setConnection(connection); selectionKey.attach(endPoint); endPoint.onOpen(); _selectorManager.endPointOpened(endPoint); _selectorManager.connectionOpened(connection); if (LOG.isDebugEnabled()) LOG.debug("Created {}", endPoint); }
private void createEndPoint(SelectableChannel channel, SelectionKey selectionKey) throws IOException { EndPoint endPoint = _selectorManager.newEndPoint(channel, this, selectionKey); Connection connection = _selectorManager.newConnection(channel, endPoint, selectionKey.attachment()); endPoint.setConnection(connection); selectionKey.attach(endPoint); endPoint.onOpen(); _selectorManager.endPointOpened(endPoint); _selectorManager.connectionOpened(connection); if (LOG.isDebugEnabled()) LOG.debug("Created {}", endPoint); }
private EndPoint createEndPoint(SocketChannel channel, SelectionKey selectionKey) throws IOException { EndPoint endPoint = newEndPoint(channel, this, selectionKey); endPointOpened(endPoint); Connection connection = newConnection(channel, endPoint, selectionKey.attachment()); endPoint.setConnection(connection); connectionOpened(connection); if (LOG.isDebugEnabled()) LOG.debug("Created {}", endPoint); return endPoint; }
@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 void upgrade(Connection newConnection) { Connection old_connection = getConnection(); if (LOG.isDebugEnabled()) LOG.debug("{} upgrading from {} to {}", this, old_connection, newConnection); ByteBuffer prefilled = (old_connection instanceof Connection.UpgradeFrom) ?((Connection.UpgradeFrom)old_connection).onUpgradeFrom():null; old_connection.onClose(); old_connection.getEndPoint().setConnection(newConnection); if (newConnection instanceof Connection.UpgradeTo) ((Connection.UpgradeTo)newConnection).onUpgradeTo(prefilled); else if (BufferUtil.hasContent(prefilled)) throw new IllegalStateException(); newConnection.onOpen(); }
@Override public void upgrade(Connection newConnection) { Connection old_connection = getConnection(); if (LOG.isDebugEnabled()) LOG.debug("{} upgrading from {} to {}", this, old_connection, newConnection); ByteBuffer prefilled = (old_connection instanceof Connection.UpgradeFrom) ?((Connection.UpgradeFrom)old_connection).onUpgradeFrom():null; old_connection.onClose(); old_connection.getEndPoint().setConnection(newConnection); if (newConnection instanceof Connection.UpgradeTo) ((Connection.UpgradeTo)newConnection).onUpgradeTo(prefilled); else if (BufferUtil.hasContent(prefilled)) throw new IllegalStateException(); newConnection.onOpen(); }
@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; }