Tomcat container application thread pool isolation method, device and medium based on Java Agent
Патент · CN B
Полный текст
The invention discloses a method, equipment and medium for isolating a Tomcat container application thread pool based on Java Agent, which relate to the technical field of Java and comprise the steps of loading an Agent program through a Java Agent mechanism when a Tomcat container is started, and initializing a global application thread pool manager by the Agent program; the method comprises the steps of carrying out byte code conversion on a network request processing class of a Tomcat container through an Agent program, inserting a routing code into a request processing method of the network request processing class, creating a corresponding independent thread pool for each Web application deployed in the Tomcat container through an application thread pool manager, acquiring a Web application identifier to which the HTTP request belongs when the HTTP request is received through the routing code, acquiring the corresponding independent thread pool from the application thread pool manager according to the Web application identifier, submitting a processing task of the HTTP request to the acquired independent thread pool for execution, and preventing the processing task from being executed in an original shared thread pool of the Tomcat container, so that multi-application thread pool isolation in the Tomcat container can be realized without invasion.