How do you set both port and thread pool using embedded jetty, v 9.1.0

后端 未结 4 2314
猫巷女王i
猫巷女王i 2021-02-20 00:09

I\'m using jetty 9.1.0, embedded, and would like to set both port and ThreadPool. I see a constructor for each, but don\'t see how to use one of those, and then any way to set t

4条回答
  •  攒了一身酷
    2021-02-20 00:31

    I can't test it right know, but I assume you can

    a) Use a configuration file and load it

    or

    b) Use the QueuedThreadPool and do the following:

     SelectChannelConnector connector = new SelectChannelConnector();
     connector.setPort(9090);
     server.addConnector(connector);
    

提交回复
热议问题