ToJetty7As an analysis target,JettyIs composed of one or moreConnectorCore Components and columnsHandlerComponents and a thread pool, let's take a look at the structure:
COnnectorMonitors and receives client connection requests.HandlerThe component is responsible for processing requests and giving responses. The thread resources required for the previous two components to work are directly from the thread pool.ThreadPool.JettyServerThere can be multipleConnectorListen to customer requests on different ports, and eachConnectorDifferent implementations can be implemented based on specific application scenarios, such as non-blockingNioConnector, BlockingSocketConnectorAnd so on.HandlerComponents, you can also use differentHandlerThis design improvesJettyThe flexibility requiredServlet, You can useServletHandler, RequiredSession, Then add anotherSessionHandlerIn other words, we can not useServletOr