@Override public List<String> protocols() { return getProtocols(); }
public SPDYServerConnectionFactory(int version, ServerSessionFrameListener listener) { super("spdy/" + version); this.version = (short)version; this.listener = listener; setInitialWindowSize(65536); setDispatchIO(true); }
@Override protected AbstractConnection newServerConnection(Connector connector, EndPoint endPoint, SSLEngine engine, List<String> protocols, String defaultProtocol) { return new NPNServerConnection(endPoint, engine, connector, protocols, defaultProtocol); } }
@Override public Connection newConnection(Connector connector, EndPoint endPoint) { CompressionFactory compressionFactory = new StandardCompressionFactory(); Parser parser = new Parser(compressionFactory.newDecompressor()); Generator generator = new Generator(connector.getByteBufferPool(), compressionFactory.newCompressor()); ServerSessionFrameListener listener = provideServerSessionFrameListener(connector, endPoint); SPDYConnection connection = new ServerSPDYConnection(connector, endPoint, parser, listener, isDispatchIO(), getInputBufferSize()); FlowControlStrategy flowControlStrategy = newFlowControlStrategy(version); StandardSession session = new StandardSession(getVersion(), connector.getByteBufferPool(), connector.getScheduler(), connection, endPoint, connection, 2, listener, generator, flowControlStrategy); session.setWindowSize(getInitialWindowSize()); parser.addListener(session); connection.setSession(session); sessionOpened(session); return configure(connection, connector, endPoint); }
public HTTPSPDYServerConnector(Server server, HttpConfiguration config, SslContextFactory sslContextFactory, Map<Short, PushStrategy> pushStrategies) { super(server, AbstractConnectionFactory.getFactories(sslContextFactory, sslContextFactory == null ? new ConnectionFactory[]{new HttpConnectionFactory(config)} : new ConnectionFactory[]{new NPNServerConnectionFactory("spdy/3", "spdy/2", "http/1.1"), new HttpConnectionFactory(config), new HTTPSPDYServerConnectionFactory(SPDY.V3, config, getPushStrategy(SPDY.V3, pushStrategies)), new HTTPSPDYServerConnectionFactory(SPDY.V2, config, getPushStrategy(SPDY.V2, pushStrategies))})); NPNServerConnectionFactory npnConnectionFactory = getConnectionFactory(NPNServerConnectionFactory.class); if (npnConnectionFactory != null) npnConnectionFactory.setDefaultProtocol("http/1.1"); }
public HTTPSPDYProxyServerConnector(Server server, SslContextFactory sslContextFactory, HttpConfiguration config, ProxyEngineSelector proxyEngineSelector, NegotiatingServerConnectionFactory negotiatingFactory) { super(server, Objects.requireNonNull(sslContextFactory), negotiatingFactory, new SPDYServerConnectionFactory(SPDY.V3, proxyEngineSelector), new SPDYServerConnectionFactory(SPDY.V2, proxyEngineSelector), new ProxyHTTPConnectionFactory(config, SPDY.V2, proxyEngineSelector)); negotiatingFactory.setDefaultProtocol("http/1.1"); } }
@Override public void protocolSelected(String protocol) { if (LOG.isDebugEnabled()) LOG.debug("{} protocol selected {}", this, protocol); setProtocol(protocol != null ? protocol : getDefaultProtocol()); NextProtoNego.remove(getSSLEngine()); }
public SPDYServerConnector(Server server, ServerSessionFrameListener listener) { super(server, (SslContextFactory)null, new SPDYServerConnectionFactory(SPDY.V2, listener)); }
public HTTPSPDYProxyServerConnector(Server server, SslContextFactory sslContextFactory, HttpConfiguration config, ProxyEngineSelector proxyEngineSelector) { this(server, sslContextFactory, config, proxyEngineSelector, new NPNServerConnectionFactory("spdy/3", "spdy/2", "http/1.1")); }
@Override public void unsupported() { protocolSelected(getDefaultProtocol()); }
@Override public void onClose() { super.onClose(); sessionClosed(getSession()); }
public static void checkProtocolNegotiationAvailable() { if (!isAvailableInBootClassPath("org.eclipse.jetty.alpn.ALPN") && !isAvailableInBootClassPath("org.eclipse.jetty.npn.NextProtoNego")) throw new IllegalStateException("No ALPN nor NPN classes available"); }
/** * @deprecated use {@link #checkProtocolNegotiationAvailable()} instead. */ @Deprecated public static void checkNPNAvailable() { checkProtocolNegotiationAvailable(); }
@Override protected void doStop() throws Exception { closeSessions(); super.doStop(); }
@Override protected void dumpThis(Appendable out) throws IOException { super.dumpThis(out); dump(out, "", sessions); }
@Override public void run() { // NPE guard to support tests if (listener != null) listener.onConnect(getSession()); } }
@Override public void onOpen() { super.onOpen(); if (connected.compareAndSet(false, true)) getExecutor().execute(this); }
@Override public void close() { NextProtoNego.remove(getSSLEngine()); super.close(); } }
public SPDYServerConnector(Server server, SslContextFactory sslContextFactory, ServerSessionFrameListener listener, NegotiatingServerConnectionFactory negotiator) { super(server, Objects.requireNonNull(sslContextFactory), negotiator, new SPDYServerConnectionFactory(SPDY.V3, listener), new SPDYServerConnectionFactory(SPDY.V2, listener), new HttpConnectionFactory()); negotiator.setDefaultProtocol("http/1.1"); } }
public SPDYServerConnector(Server server, SslContextFactory sslContextFactory, ServerSessionFrameListener listener) { this(server, sslContextFactory, listener, new NPNServerConnectionFactory("spdy/3", "spdy/2", "http/1.1")); }