runtime/local_jetty12_ee10/src/main/java/com/google/appengine/tools/development/jetty/ee10/JettyContainerService.java [331:375]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  protected void connectContainer() throws Exception {
    moduleConfigurationHandle.checkEnvironmentVariables();

    // Jetty uses the thread context ClassLoader to find things
    // This needs to be null for the DevAppClassLoader to
    // work correctly. There have been clients that set this to
    // something else.
    Thread currentThread = Thread.currentThread();
    ClassLoader previousCcl = currentThread.getContextClassLoader();

    HttpConfiguration configuration = new HttpConfiguration();
    configuration.setSendDateHeader(false);
    configuration.setSendServerVersion(false);
    configuration.setSendXPoweredBy(false);
    // Try to enable virtual threads if requested on java21:
    if (Boolean.getBoolean("appengine.use.virtualthreads")) {
      QueuedThreadPool threadPool = new QueuedThreadPool();
      threadPool.setVirtualThreadsExecutor(VirtualThreads.getDefaultVirtualThreadsExecutor());
      server = new Server(threadPool);
    } else {
      server = new Server();
    }
    try {
      NetworkTrafficServerConnector connector =
          new NetworkTrafficServerConnector(
              server,
              null,
              null,
              null,
              0,
              Runtime.getRuntime().availableProcessors(),
              new HttpConnectionFactory(configuration));
      connector.setHost(address);
      connector.setPort(port);
      // Linux keeps the port blocked after shutdown if we don't disable this.
      // TODO: WHAT IS THIS connector.setSoLingerTime(0);
      connector.open();

      server.addConnector(connector);

      port = connector.getLocalPort();
    } finally {
      currentThread.setContextClassLoader(previousCcl);
    }
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



runtime/local_jetty12/src/main/java/com/google/appengine/tools/development/jetty/JettyContainerService.java [324:368]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  protected void connectContainer() throws Exception {
    moduleConfigurationHandle.checkEnvironmentVariables();

    // Jetty uses the thread context ClassLoader to find things
    // This needs to be null for the DevAppClassLoader to
    // work correctly. There have been clients that set this to
    // something else.
    Thread currentThread = Thread.currentThread();
    ClassLoader previousCcl = currentThread.getContextClassLoader();

    HttpConfiguration configuration = new HttpConfiguration();
    configuration.setSendDateHeader(false);
    configuration.setSendServerVersion(false);
    configuration.setSendXPoweredBy(false);
    // Try to enable virtual threads if requested on java21:
    if (Boolean.getBoolean("appengine.use.virtualthreads")) {
      QueuedThreadPool threadPool = new QueuedThreadPool();
      threadPool.setVirtualThreadsExecutor(VirtualThreads.getDefaultVirtualThreadsExecutor());
      server = new Server(threadPool);
    } else {
      server = new Server();
    }
    try {
      NetworkTrafficServerConnector connector =
          new NetworkTrafficServerConnector(
              server,
              null,
              null,
              null,
              0,
              Runtime.getRuntime().availableProcessors(),
              new HttpConnectionFactory(configuration));
      connector.setHost(address);
      connector.setPort(port);
      // Linux keeps the port blocked after shutdown if we don't disable this.
      // TODO: WHAT IS THIS connector.setSoLingerTime(0);
      connector.open();

      server.addConnector(connector);

      port = connector.getLocalPort();
    } finally {
      currentThread.setContextClassLoader(previousCcl);
    }
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



